Jump to content

Thinking about Switching


charliez
 Share

Recommended Posts

Hi,

I am thinking about switching to ProcessWire. So far I am really liking what I see

but I have a couple of questions:

- Is there a Blog module in the works? or is there a best practice for blogs?

- What is the best way to do login/authentication to the website? Again, is there a module in the works?

- I see that there are some jQuery modules. Can we run jQuery plugins just by including them or do we have to create a Module first?

- Can we input PHP code in the fields? or just text and HTML?

Thanks in advace for you advice...

Link to comment
Share on other sites

If you could be a bit more specific about where you are switching from and what you would like to achieve/make it would be easier to advise. PW is a very flexible tool with almost all of the building blocks to create great sites fast. I've seen people migrate from typo3, drupal, wordpress etc., so this is all within the realm of possibilities. If you haven't done so already i would just install PW a give it a spin. Play around with some templates, add a couple fields, do some page relations etc.

Regarding your questions:

- Not that i'm aware of. PW doesn't dictate how you setup and structure your sites. It's pretty easy to setup blog functionality though. However, if all you want to do is blog there are other systems available that are more geared towards out of the box.

- Not sure

- You want to use these plugins in the PW backend?

- Haven't tried to input PHP code in fields myself, don't know if this is possible. It doesn't really sound like something you would want to do. In general i think this belongs in template files, modules etc.

  • Like 1
Link to comment
Share on other sites

- Is there a Blog module in the works? or is there a best practice for blogs?

Nico create a blog module. I haven't tried it myself, but you could give it a try:

http://processwire.c...__fromsearch__1

- What is the best way to do login/authentication to the website? Again, is there a module in the works?

Processwire has built in user management with different user roles. Is that what you are looking for?

- I see that there are some jQuery modules. Can we run jQuery plugins just by including them or do we have to create a Module first?

jQuery for the backend is included. If you want to use jQuery on your frontend, you would simply call jQuery from your template.

- Can we input PHP code in the fields? or just text and HTML?

Why would you need this? I agree with SiNNuT that PHP should be in the templates, modules etc.

As I see it (simplified but still...) fields can be populated from the admin by editors. Templates and modules are created by designers/coders.

Would you really want to have editors writing php code?

/Jasper

  • Like 1
Link to comment
Share on other sites

Thanks for the fast responses, Sinnut & Jasper!

- Nico's blog module looks really good, and a great start to improve on it. Thanks for the link.

- I found user management after I ask the question, thanks, looks good too.

- Yes, I want to use jQuery in front and in the back. The front is as usual, including it and the plugin.

In the backend, I will use it to enhance some customers experience. Tables, tabs, etc., good to know

that it is included.

- I am thinking on using the fields as template variables. I will try it to see if it works. I will call in my template

the major building blocks as fields (content, aside, footer, header, navigation, etc.) and then fill them in with

HTML in the admin. But to make a variety of layouts, I could call more fields (echo them) inside the field. For

example: divide the footer in three and call the blocks 'left_footer', 'right_footer', 'middle_footer' in the field.

All this fields will be hidden from the users, and are just created for ease and consistency of the developer.

Thanks again... I will play more with PW, looks great!

Link to comment
Share on other sites

Welcome, Charliez

I am thinking on using the fields as template variables.

Hehe. It seems like you are coming from MODx realm, right? :) You don't really need to do it in PW the way you did it in MODx. I think what you mayby need is pages serving as building blocks, so that you can choose what blocks you want to use on your page and then just call them to render themselves in your template. Maybe it sounds a little complicated at first, but it's really easy after you've wraped your head around PW's philosophy. And yeah, storing php in fields is evil :)

  • Like 1
Link to comment
Share on other sites

Thanks slkwrm,

Yep, I am coming from the MODX realm, hehe. I still think that it is a great CMS,

but I really like PWs simplicity of doing things and its jQuery back-end.

SO the building blocks would be like mini-pages...

and then they are called in the template.

But then I need to populate the "blocks/mini-pages" with fields and maybe PHP? 8)

Do you have an example of this? or a link to the docs/forum about this technique?

Link to comment
Share on other sites

Welcome Charliez!

When it comes to using jQuery on the front end, pretend that ProcessWire isn't there. Link to jQuery the way you usually would, whether through Google's CDN or by storing a copy locally in /site/templates/scripts/ (or wherever you prefer to). I think it's better that you don't utilize the same jQuery as ProcessWire's back-end because the needs of your site and the needs of PW's backend may be very different. You should also be able to upgrade one without the other. No need to have a front-end to back-end dependency like that.

Using PHP in fields is generally not recommended because 1) it's not terribly efficient; and 2) It means that anyone with admin access (that knows their PHP) can bypass any and all security. The same goes for any CMS system that lets you enter PHP in fields. Likewise, the security of your server is then only as good as your client's worst password. PHP is just plain powerful, so I think it's good to limit its access to developers. Even if your client knows no PHP, a resourceful hacker may someday discover your client's crafty password ("b00b13s") and find their way in. If you give them PHP access, your web server will find most of its resources going towards running an IRC w4r3z server and DDOSing the CIA … Or maybe not, but that was my experience with WordPress last month. :)

After all that, if you must enable PHP from your fields, you'll want to eval() it from your template. This is essentially what any other system that lets you use PHP in fields does. So if you have a field called 'php_code' assigned to your template, you'd execute it like this from your template:

eval($page->php_code); 

I think that once you get deeper into PW, you'll find that PHP in fields is oldschool CMS methodology and not something that's really necessary in ProcessWire.

With regards to blogging, I've always felt that WordPress answers just about every need in this area, so I've not tried to venture very far into that, and instead focus on the things that ProcessWire can do better than any other platform out there. Though it turns out that PW can be quite a great blogging platform (perhaps even better than WP in many respects). So I think you'll be seeing more and more pre-made options for this in ProcessWire as the platform matures.

Also thanks to Sinnut, formmailer and slkwrm for the great replies.

Link to comment
Share on other sites

Welcome fellow MODx user ;)

As someone who's migrated a few sites to PW from MODx already, and is in the process of converting a site with dozens of template variables/snippets and hundreds of pages from MODx to PW, I'll echo what's been said above to some degree:

You won't need PHP in the back-end. It's a bold claim as I don't know what TVs you had set up, but if you would like to post a few examples I'll be happy to show you how to do them in PW.

The hardest part is unlearning whichever CMS' you've used previously - I still find myself looking for more complex solutions when there are perfectly easy ways to do things in PW.

Overall, ditching my snippets in favour of creating more readable code inside templates (with good old-fashioned includes) and not having to use TVs, my code has been reduced dramatically in terms of length and is easier to read.

So... not sure where I was going with this - but yeah, if you'd like to give an example or two of how you use TVs now then we can show you the PW way.

  • Like 1
Link to comment
Share on other sites

SO the building blocks would be like mini-pages...and then they are called in the template.

These can be as simple as typing the blocks into a PHP file, like "building_block_a.inc.php" and then putting this in your template: <?php include('./building_block_a.inc.php'); ?>

But then I need to populate the "blocks/mini-pages" with fields and maybe PHP?

Yes, so inside of building_block_a.inc.php you can use ANY ProcessWire calls you like. So you can put <?php echo $page->sidebar; ?> and it will pull in the sidebar from the current page. You can display any field from any page on the site.

Much different from working with MODx, but simpler I think :) ...and no extJS ha ha

  • Like 1
Link to comment
Share on other sites

Yes, so inside of building_block_a.inc.php you can use ANY ProcessWire calls you like. So you can put <?php echo $page->sidebar; ?> and it will pull in the sidebar from the current page.

In this case, would even be better to have a page and a template (not connected with a file) only with the fields for the sidebar, and call them from building_block_a.inc.php like this:

$pages-> get(123)->name_of_field

where 123 is the id of the sidebar page

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...