From drupal to web2py: taxonomy/tagging and comments? - comments

I have some sites that I implemented using Drupal. However as cool as Drupal is I've never been satisfied with coding in it mostly because it's in PHP and I've wanted to work with python. I've flirted with Django but I just recently discovered web2py and it's definitely caught my eye. Seems like it may be a sweet spot between Drupal and Django. Although django-cms is also on my radar.
So now I'm wondering how to re-implement my sites with web2py. Specifically suppose I have a site about DVD players. So in Drupal I'd have a CCK type DVD player, with various attributes. I guess this would correspond to a web2py model. How would I implement something like Drupal's taxonomy which is like a tagging system in web2py? Is there a module/plugin/appliance for that? Or am I manually creating the model schema to handle tagging?
Secondly, how would you handle something like comments and/or reviews on posts? Again, is there a pre-built plugin for this or do I have roll my own?

For tagging, I don't think web2py has anything quite like the Drupal Taxonomy module, but there are some options. First, you could create your own many-to-many model to assign tags to items. Another simpler option is to use web2py's list:reference field type to de-normalize the many-to-many relationship (the end of that section in the book includes a tagging example).
For existing tagging solutions, you can also check out web2py's plugin_wiki, which includes a tag widget. You can get it from the download page, or pull the source code directly. Another option is Powerpack, which includes the Instant Press CMS, which includes tagging and categories functionality.
Also, both plugin_wiki and Powerpack include comment plugins.
Finally, you'll generally get more and quicker responses from knowledgeable web2py users on the web2py mailing list.

Related

Joomla: comments for own component

I have written my own Jommla component for displaying particular information (for example car info: engine power, year and etc.).
Now I want to add a comments to my component.
Implementing comments by my own is too hard and it's not very safe.
Maybe someone had and experience integrating some existing joomla component for an own component?
Update:
Maybe I can copy-paste code of some existing joomla comments component in my own component?
Does somebody tried to do this?
You should be careful with bespoke comments fields as they are open to spam attacks, unless carefully filtered and moderated.
If it would work for your needs, you are probably better building a simple module which embeds the Facebook or Disqus comment widgets onto your site, and then assigning it to your component pages. These seem to be quite good at stopping most of the spam.

One-page AJAX-based WordPress site. How should I do it?

I am trying to create a one-page WordPress website, something like the ones you sometimes see in ThemeForest's WP section: the whole website is a long page that has everything in one place, from about us, to portfolio, to some blog posts, to contacts.
Placing all things on one page is not difficult. But when I started thinking about how to present individual posts and pages, I realised that I probably need a general way of getting posts' data via AJAX, and create new blocks with JS. How should I go about this? I suppose this was done before, but I struggle to find something this specific on Codex or a tutorial with best practices.
Any advice or link will be greatly appreciated.
You could use a plugin such as jQuery Easytabs, download it here, that has a built-in Ajax component.
I've found that the easiest way is to just get all content to load into the divs ahead of time, vs. trying to load all pages through Ajax. However, appending something like '?ajax/ajax' to the end of your urls through the Easytabs plugin is one option that I have successfully used in the past.
If you decide to use the easytabs functionality, there is ample documentation on the page that I linked to.

wordpress plugin making friendly URLs and accessing variables

I've been searching for a couple of days for a particular answer to my question. I have written a custom plugin for wordpress which we will be using on our site. It was easier to make this a custom plugin rather than trying to use or hack existing ones.
As an example, let's say we are selling cars. My plugin lets us create a new car, upload a photo and write reviews about that car. This is all done through my plugin.
I now need to integrate that to the existing site using friendly urls.
I'd like domain.com/cars/ford-focus/2234 as the url. that would look like index.php?pagename=cars&model=matched[1]&otherid=matched[2]
also domain.com/category/hatchback would be index.php?pagename=category&cat=matched[1]
Both those urls would call a function and I will display the records on the page.
I am really struggling as to whether I create a page called "cars" and have a [shortcode] or do I handle everything in my plugin and rewrite urls. I have tried all sorts and its just not working. I don't know if I fully understand the way it works!?
Also - I have tried the route of using custom post types etc, but for our needs it's not right.
Thanks for any help!!

Magento custom fields on checkout

Is there any tutorial available for how do i add custom fields on front end check out step like PO number,Job name , customer comments etc as well as in admin->create->order.
My usual motto is to find (and buy if needed) a module that already has the functionality you seek. Especially when the life of this project involves version upgrades because then you can seek a pre-packaged solution from the provider.
I regret every bit of custom code I have added to our Magento install. Because now I've got to maintain the site to just keep working in addition to figuring out my hacks. Time to devote more time to replacing hacks with off-the-shelf extensions, which would have been much faster in the first place.
I know this attitude goes somewhat against the stack overflow thinking of I can do anything, but really, Magento's job is to enable someone to do less work.
Two years later, an update: after the gentle poke of a downvote (probably for appearing to shrug off the question), I am back to revisit and share some of what I've learned. The programming aspect of additional fields is the concept of persistence of the data.
If you're ok with the custom fields only appearing in the transactional emails following the order, then the task is as "simple" as adding the fields to the form somewhere and then updating the controller to to catch and insert the post data into the email. You can use a custom variable in the back end to readily expose this to the email templates. And a Magento SE on programatically creating a custom variable.
Getting persistence into the back end requires adding database fields via an installer in your module. The iCoreThink blog lays out the steps clearly and explains why, how to confirm your work, and then provides real-world implementation, like displaying to the customer in their account. The "other blog" mentioned below has a great example of this, though his example is specifically related to billing and shipping.
Resources from my upvotes and bookmarks:
» This iCoreThink blog post is my favorite reference so far and what I'm following now.
» I was using Templates Master's FireCheckout which includes their own checkoutfields module, but I've abandoned their single view checkout for the flow of Magento's one page checkout. I'm now trying to adapt their checkout fields (and use their controller) into my template for checkout.
» I thought for sure Alan Storm wrote an article about Checkout custom fields, but I don't see one.
» This Magento SE lists a couple blogs and a paid extension. The excellence blog is ok, but his style is too rote for me and I don't learn anything. The other blog discusses the procedure for building your module and installing the database fields.
» The unexpected-IT blog demonstrates and informal hack to add the code to core files (but sadly doesn't show how to override those files by copying them to app/code/local) and the steps to manually perform to get the column and fields added in the database. Apparently is perfect for 1.4 and below, but comments seem to explain what to do for 1.5 and up.
This last hack-ish change is my personal favorite as it seamlessly adds the extra bits into existing Magento admin pages and "feels like" less work. Caveats: I wouldn't do this without using version control and it will absolutely break if any core code changes happen between version upgrades.

How to create my own form in joomla

I want to create my own form that are submitted and values of that form will be stored in joomla database. How can i used the Joomla connection code to interacte with the joomla database.
If you just want to get your work done, there are some components already avaiable in Joomla Extension's website to your form's needs. CkForms is a good one, you can create simple forms with it that are automatically saved in the database (supports upload of files too).
If you want to learn how to write extensions in Joomla, you should read Joomla Official Documentation website.
Extensions in Joomla are divided in "Components", "Modules" and "Plugins". More informations about these differences can be found here and here.
What you're trying to achieve sounds a "component" to me. Downloading the CkForms and reading it's source code should get you started to Joomla's way of writing components.
EDIT: Joomla has a huge API with a lot of features. It has a database module of it's own, with insert methods and such. Reading Joomla's API website before implementing your component it's a good idea to avoid "reinventing the wheel" and it's a good practice since those methods are extensively tested by all Joomla users.
The JForm class helps you build forms.
Documentation can be found here:
joomla CMS: http://docs.joomla.org/API16:JForm
joomla API: http://api.joomla.org/11.4/Joomla-Platform/Form/JForm.html
This class provides you with ready to use form elements and form loading and/or processing methods
This class includes validation methods, date picker control, color picker, etc.
Of course, as another mentioned above, if you are building a module, component, or application, you will need to learn how to to develop a module, component or application. Of these three, the module is the easiest to implement.
The application gives you much freedom b/c you are not constrained to the CMS paradigm, front and back end complexities. However, there is little documentation about how to develop applications with Joomla framework b/c joomla as a framework is relatively new
This tutorial gets you started understanding how to use JForm to create a form in Joomla: http://www.ostraining.com/blog/how-tos/development/getting-started-with-jform/
Or you could just create add a html module to any position and then write the form in html i.e.
<form method="post" action="mycreatedpage.php"> <input type="text"/> <input type="submit">
Now just create a page that handles the code by emailing or inserting into db. I havent tried it but i think it should work.
Looks like everyone already told you almost everything I know except for the component creator. Very easy to use, and it follows Joomla standards. Will get you up and running within minutes.
I have got good working experience with Joomla RSForm Pro. It has got options for
validation
user email/admin emails on submit
file uploads
and many more
Good tutorials too. Get started with http://www.rsjoomla.com/support/documentation/view-knowledgebase/21-rsform-pro.html
Good luck!
Create View.
Create Model.
Create Table.
Create Controller ( if Needed ).
Create Form xml file.
Go here for more information:
http://docs.joomla.org/Standard_form_field_types
Take a look at the Chronoforms extension - does more than you want.
You have two options:
Use an already built custom form extension
Create your own custom form extension (or outsource it)
Now if you only want to modify the user registration form, then you can do some PHP customization to accomplish your goal.
Making forms in Joomla can be done in a couple of ways.
If you just wanted a contact us, you can just create a page with a menu item for the User contact form. This gives you a page with a Members address and contact form. So all you would need to do was add the user as the company of the websites home address and email. But the form is very basic, name, title, textarea for message.
Next up from that you could just make a Custom HTML module add add a form to it in plain HTML like +Sean said above this, you would need to code in PHP your own form process script. You would not get error in form data checking unless you also wrote it.
Next you might rather look on the Joomla Extension Directory JED for one of the good extensions for 3 and 2.5 Joomla RSForms!Pro is good, and can do all we have needed. This lets you add fields one by one and move your form around. Then can auto generate or custom the html of the form.
You can easily create your own forms with Fabrik
Chronoforms are now a days a very popular solution for custom forms in joomla. Chornoforms support twitter bootstrap also. In simple 5 steps you can create a contact form with unlimited fields and also embed various function like DB save, Email, Thanks Message, Redirection on any page. There is events and events will have particular events.
Also possibility of extension of Normal joomla registeration. It will not extend the core registration but at the time of registration you can take various information from users.
I would use Chrono Forms, they work really well and are easy to use.
Download here
Here is a full tutorial on the new Chronoforms 5 to help you get started quickly and understand most of the features available.
CLICK HERE
You can use plugin to insert external php form in content. It is easy and you don't need to make plugin etc. Please use this.
I suggest you to use breezingforms: http://crosstec.de/en/extensions/joomla-forms-download.html
It's one of the best solutions for custom form creation in joomla.

Resources