-
Posts
7,529 -
Joined
-
Last visited
-
Days Won
160
Everything posted by kongondo
-
How to do this in PW - modx ditto stuff
kongondo replied to OllieMackJames's topic in Getting Started
I know am beginning to sound like a broken record but once PW clicks, you wonder why you didn't use it before. I used to shudder at the thought of getting in the guts of MODX to write my own snippets and would hide behind template engine syntax. Nothing wrong with that approach but am now convinced the PW way is better. I am glad I gave PW a spin. For instance, although both PW and WP do not use template engines, you try creating/editing a WP template! I totally hated it. The cool (maybe the coolest thing? I need to do a poll about this;)) thing with PW is its powerful and friendly selectors. Noobs like me can actually query the database in complex ways and retrieve data with minimal effort; yikes! Seriously, how do you beat $pages->find(); It can't get simpler than that! /k -
How to do this in PW - modx ditto stuff
kongondo replied to OllieMackJames's topic in Getting Started
Ollie, $count = 0; // Suppose this is just setting the starting point for counting? Yes $class = ""; // Suppose this makes it empty, waiting to be filled? Yes. Create an empty variable. $count++; //keep counting? Yes. Push the counter forward once each time. if ($count % 2 == 0) { // if count divided by 2 equals zero? Nearly..Means if remainder of where the count is when you divide by 2 equals zero (i.e. even number). If there is a reminder, it is an odd number Diogo strikes again! Oh well.. Just my 2 cents...am no coder either cheers /k -
Could someone please give me examples of using the selector "include=hidden" in the above examples by Ryan and Diogo? I tried this and wasn't able to fetch hidden grandchildren. How do I get "hidden" children? What about both "hidden" parent and grandchildren? Thanks. Btw, in the API docs it says. Is this true for get() as well? Thanks /k
-
Maybe we can add these perspectives to the discussion? How to create many-to-many relationship Discussion/debate over correct or sensible use of repeater fields Modelling data in PW (page relations) Not sure they are all relevant to this topic though... My 2 cents /k
- 24 replies
-
Does Processwire Allow Unicode Path Names?
kongondo replied to bytesource's topic in Multi-Language Support
-
What happened to the screencast? /k
-
Thanks Ryan for the extra info. /k
-
ProcessPageHidden and ProcessPagePublish
kongondo replied to geniestreiche's topic in Modules/Plugins
Hi geniestreiche, Thanks for these modules. I was wondering if it would be better to toggle the pageListActionLabel labels depending on the status of that page. So, show label "hide" if page is not hidden and show "unhide" if page is hidden. Same for the published status, i.e. show "publish" if page is not published and "unpublish" if page is published. Visually, this makes more sense to me. I am no coder but I've made quick dirty hacks in local copies of the module to do just this. See attachment. I'm sure your code will be cleaner than mine . Many thanks. Cheers /k -
Apeisa, Thanks for this. Simply awesome! /k
-
Does something similar to below not work? if($page->hide_from_top_menu == 0){ } See this thread and the solution (post #9) as well as the issues about '=' versus '=='. Can't find it now but if I remember correctly, in PW checkbox is either 0 (unchecked) or 1 (checked). I could be wrong /k
-
Thanks both!
-
Hi, In admin -> setup -> templates under basics, under the option "Label" it says "An optional label to describe this template." I thought the text input in this label option is only for descriptive admin purposes, e.g. to help multiple admins know what a particular template is about when viewing the list of templates available on a site. To my dismay, if you use this label option, this text is what appears under "template*" when editing a page. Is this the intended behaviour? I would have thought the template selection field under page settings would show template names rather than template labels since labels can be long. Can this behaviour be changed? Haven't found a setting. Using PW 2.3. Thanks. /k
-
Multiple page select - limit number of selections
kongondo replied to kongondo's topic in General Support
Thanks Martijn -
Hi, Using a multiple select page field, there is no way to limit the user to select a set maximum number of pages, is there? For instance, force them to select a maximum of 4 pages from a possible 20 pages when using that field? Short of writing the instructions for them in the field's description, is there some other way? Thanks. Cheers. /k
-
Hi Franci, Welcome to ProcessWire! Regarding tutorials, have a look at this if you haven't seen them already: http://wiki.processwire.com/index.php/Basic_Website_Tutorial http://processwire.com/talk/forum/13-tutorials/ Many examples are provided right here in the forums but that can be difficult to find if you are new. I am sure others will provide more helpful answers but I can add PW is very secure. I'll let the more seasoned PW pros chime in here. By the way, learning PHP is good but you don't need advanced PHP knowledge to use PW. Coming in from Joomla, you will be amazed at the freedom PW gives you. You will need to unlearn Joomla ways though , e.g. be willing to get your hands a little bit dirty with some code. Once PW clicks, you will wonder why you hadn't used it before . Anyway, this is a very helpful forum and someone will soon give you better answers than mine! Cheers /k
-
Pwired, See my post (#11) above. I refer to this tutorial. The same principle can be used to use fields as chunks. MODX defines chunks as bits of static text which you can reuse across your site. In PW, chunks do not have to be text. They can be images, for instance. Based on that tutorial, the basics are: Create the fields you will need to hold chunk data. Choose from the different field types and settings as you require. Also for each field, fill in other helpful information such as field label. You can go further and add settings such as maximum length of field, placeholder text, etc. Example chunks could be a text field to hold contact information, company slogan, some footer text, etc. Create a chunks template. Call it chunks_template or whatever you fancy. Don't associate it with any template file. Edit and save the chunks_template to add the fields you have created to use as chunks. In the settings, you may wish to disable the "May Pages using this template have children?". Later, once you have done #3 below, you can also disable the "Can this template be used for new pages" setting. Create a chunks page that will be exclusively used to hold your chunks. You can call it "chunks". Let this page use your chunks template in #2 above. Mark the page as hidden but publish it. You will be able to access/use the chunk fields but this page will not appear in menus. Use PW API to grab and spit out your chunks where you want them to appear in your site (see examples in the wiki tutorial). For instance, assuming you named your chunks page "chunks" and have a contact information field called "contact_info" as one of your chunks field, you could grab and display this using the following code in your template file(s) associated with your other pages (i.e. other template files and not the chunks template ): <?php echo $pages->get("/chunks/")->contact_info; ?> Using this method, true to the philosophy of chunks, you can edit once and update all instances of the chunks. Even better, you edit everything in one place (page). You can do other fancy things such as: use Fieldset fields to group your chunks by "category" in your chunks page. E.g. contacts category, site meta information category, etc. Use PHP if statements to display chunks on certain pages and not others, on certain days, seasons, etc. The possibilities are endless. Do things like this to explode and display chunk data entered as a delimited list. Note: these other "fancy" things are not limited to using fields as chunks in this way....they are just examples Hope this helps Cheers /k
-
@Peter Have the solutions suggested by Diogo and DaveP worked for you? Yes, you cannot (should not even?) place "snippets" (PHP) in text areas. I think the tag parser module would help here. Expounding on the issue of chunks, looking at the wiki tutorial on creating a settings page (plus this post), such a strategy can be used to exclusively manage chunks, i.e. creating a chunks template (without a template file) and a chunks page (hidden but published). I suppose you know this already but I thought to post this here for others/reference...The beauty with PW is that the chunks can contain all sorts of data due to the wealth of fields PW offers. You can even get fancy and group related chunks using FieldSets. /k
-
KentBrockman, Welcome to ProcessWire! /kongondo
-
Thanks Joss and Teppo for these! Cheers /k
-
Uuh, http://processwire.com/talk/forum/5-wishlist-roadmap/ /k
-
Peter, There's quite a number of us here (including me). Most(?) are no longer refugees though; we have found a new home in PW and are here to stay! . IMHO and with lots of respect for MODX, PW is not the next best thing after MODX....PW is the best thing... Good idea. Been planning to do one but never got round to it. I'm no PW guru but I think: MODX Snippets: In PW, you can replicate these in Template Files. Even more exciting, the capabilities of many MODX Snippets including the "main" MODX Snippets such as Ditto/getResources and Wayfinder are in-built in PW. The powerful PW API variables $page and $pages will do all (or most) of what you will require from Snippets. Other Snippet functionalities are provided by various PW modules. You can spice these up with some native PHP for even more advanced functionality. But $page and $pages will usually get you what you want. MODX Chunks: These you can have as "includes" in your Template Files, i.e. use PHP to include them in your Template Files. You can also replicate Chunks using PW Fields. Fields can be reused, etc. Looking forward to your MODX to PW cheat sheet! Cheers, /k
-
Brilliant work Soma! Thanks for this. Cheers. /k
-
Beautiful site Tina, good job! /k
- 9 replies
-
- 1
-
-
- musician website
- band website
- (and 5 more)