Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/08/2012 in all areas

  1. I noticed that although there's an InputfieldSelect module, there wasn't a FieldtypeSelect that would produce a drop down list (via a "select" input) that would allow you to define a list of options in the field's configuration. (Somewhere in this forum, I saw that the "Page" fieldtype was suggested to do this - and it works - but it didn't seem as easy as it should be.) So, I went ahead and created a module to do it! After installing, you'll have a new "Select" fieldtype that will allow you to define the items you'd like in the drop down. You'll be able to define these options in a text box on the field's configuration screen. Just put each option on it's own line. Hope this helps someone out! Let me know if you experience any issues with it, find any bugs or if you have some ideas on improvement. EDIT: The module is now on github: https://github.com/Hani79/Processwire_FieldType_Select_Drop_Down (Thanks for the prompt to put it up there, Soma.)
    1 point
  2. Hi gottberg and welcome to the forums. Searching these forums with the term 'treemenu' will give u 4 or 5 topics which deal with various ways to do multi-level/recursive navigation. Just choose the one which best suits your needs. In one of those topics apeisa mentioned something about a simple navigator module but i don't know if this was ever made. On a side note, and in case Ryan is reading this: These questions about menus and navigation come up a lot. Wouldn't i be a good idea to expand this page: http://processwire.c...art/navigation/ to include some information about approaches to do multi-level stuff. Maybe some common scenarios and corresponding functions?
    1 point
  3. Apeisa is right and it's by far the best approach. Don't worry even simple minded non tech people will understand how to add a page that will serve as a category. It doesn't need to be hidden, only the "/catergory/" page that holds the categories. It can't get any simpler than having a page called Categeory, then click it and click "new". Voila. You can even setup the template to only allow "category" templates as childrens under the tab "Family" in the template settings. After that you can in future even add fields like description and images, so the category could have meta data displayed. And as apeisa mentioned it even allows for multiple categories selected, the page inputfield will allow very versatile usage. There's a real connection that is most flexible. Your solution is very limited and unflexible and to my understanding even more complicated to the site admin to add a weird 1:=Label and it allows for errors very easy. No way to screw up with the page select approach. Anyway you could try this with your code, it was a real mess I guess no problem this "should" work: $features = $page->children("magazine_section=A"); if ($features->count() > 0){ echo "<h2>Feature Articles</h2>\n<ul>"; foreach($features as $feature) { echo "\n\t<li><a href='{$feature->url}'>{$feature->article_title}</a></li>\n"; } echo "</ul>\n"; }
    1 point
  4. 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'); ?> 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
    1 point
  5. 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.
    1 point
×
×
  • Create New...