-
Posts
2,756 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
@kongondo thank you - i'll check those out @jsantari - something like this should work ; <?php $group = $page->widget_group; // widget group is a repeater foreach ($group as $item) { // each repeater item has 2 fields, one is a page select called widget_group_name ?> <ul> <li><?php echo $item->widget_group_name->title; ?></li> <li><?php echo $item->widget_group_name->block; ?></li> </ul> <?php } // end foreach ?> Also want to mention that the field names are not really optimal; for example the page select should probably be just widget
-
How to setup Relations (?) for a MP3 DB with PW?
Macrura replied to horst's topic in Getting Started
ok, I will try to help out, since i'm interested in having some reusable code for this.. in the meantime, here are some things that might help: http://www.script-tutorials.com/id3-tags-reader-with-php/ http://getid3.sourceforge.net/ -
@teppo - thanks; i'm still not super hip to this whole render thing and i've searched the docs, cheatsheet and forum.. any chance you could provide a quick explanation of how render() works? cheers
-
How to setup Relations (?) for a MP3 DB with PW?
Macrura replied to horst's topic in Getting Started
@Horst - will you be implementing any functionality to read ID3 tags on those mp3 files? -
yes it sounds like you're getting booted from the admin, or there is some error going on, perhaps with duplicates in the database... one thing i would try is repairing the database, you can login to your phpMyAdmin and run the database repair
-
$item->widget_group_name->title (or whatever you need to output.) echoing a page field will always return the ID
-
so in other words you have a text field called social_upon and when you enter data into that field and save, you get a 404 error. You should post the URL that PW is redirecting to on save; try disabling some modules also, to account for possible conflicts; also post screenshot ?
-
any javascript errors or warnings in the console, when you try to get it to load the last page? Must be a js issue
- 12 replies
-
- ajax
- infinite scroll
-
(and 2 more)
Tagged with:
-
@joe_g - you could use url segments to get the URLs to look real and have the tags. as far as the structure, looks like a page select to me, with possibly some custom validation, such as max 2 for the parents. field 1: page select, selects from pages with tag 'parent' (custom selector) field 2: page select, selects from pages with tag 'child' allow creation of new pages on that page select... not sure if this is what you're after though.. right, ordering is tricky... but you could make a custom field for that too.. might need a custom module to handle global ordering by tag.
- 24 replies
-
@Alxndre - if you load /page4 into the browser, do you see the content that would load into the IS?
- 12 replies
-
- ajax
- infinite scroll
-
(and 2 more)
Tagged with:
-
easy solution - put all the pages where you want; use a custom menu no related to the page tree as explained here: http://processwire.com/talk/topic/2787-custom-menu-not-related-to-page-tree/ then make a way to find content based on tags, using the template/api and selectors. you could make your category pages be search result pages, like with this at the end /?tags= and the actual pages themselves be like this at the end /?tag= use a redirect template for the pages, so no one ever sees the 'real' url
- 24 replies
-
@jmart - if there are not a lot of pages, don't nest the pages in the admin, but then make a custom menu. That's how it do it on 3 sites now. (in other words make all of the pages child of the root.) As far as making the custom menu, i do it the way discussed in this thread, and works perfectly. You have to adjust the code to your specific menu needs.. http://processwire.com/talk/topic/2787-custom-menu-not-related-to-page-tree/ i also wanted to mention that once you have a lot of pages in the admin, you could use Soma's datatable to look for pages, instead of the tree; then you could filter/sort by some criteria (title, template); so in this sense you would using PW as more of a bucket system... which for some projects is good, and PW handles it fine...
-
well i picked up the idea from Soma to always have a 'tools.inc' file in my template folder. Then in that file i paste in the code to run, load that page, and the commands execute. I'm keeping these various snippets in codebox snippets. I agree that this method seems a little arcane, but it works well; makes it very easy to manipulate your data...just have to be careful since you're mass editing.. Back in my joomla days i used nonumber.nl DB replacer, which enabled you to do this kind of thing, and be able to preview the changes to the data, which was nice; this PW api technique is more powerful though; i make a lot of backups to my sites when i'm working on them, so in the event something goes awry i can revert.. so to sum up - YES! it would be great to have this in the backend, and even be able to preview the changes.. if someone out there likes to write a module...i would support it in any way i could.
-
know this is kind of obvious, but the last time i did that i just ran a replacement on the content with the api.. <?php $ps = $pages->find("template=basic-page"); foreach($ps as $p) { $p->setOutputFormatting(false); $new = str_replace('mysite/', '', $p->body); $p->body = $new; $p->save(); } ?>
-
nice diogo - +1 for little dragon how bout this: http://grooveshark.com/#!/artist/Holy+Ghost/566436
-
Similar to Repeater - Custom Fields not fixed to template?
Macrura replied to nexflo's topic in General Support
set all of your templates, except 'home' or whatever you're using there, to disallow children. -
Wow horst - that is super awesome; I'll have to revisit this, because i need something like this for a site i'm currently working on, where there is a product and we want to generate a slick product sheet, downloadable pdf using the existing PW content and images...
-
might be cool at some point to have a pw user survey
-
@pwired - +1 for getting a percent up front, and then keep the site on your development server until you get paid in full.. i put a coming soon page in the client's domain and then once the site is done, they need to pay the balance before the site is installed on their domain..
-
what about a simple string replace on the search results (get rid of leading the, an, a).. $sort_title = preg_replace("/^(the¦a¦an)\b\ */i", "", "Some title");
-
How to do this in PW - modx ditto stuff
Macrura replied to OllieMackJames's topic in Getting Started
also, can't you do this: if ($count % 2) instead of this: if ($count % 2 == 0) or maybe bitwise - supposedly faster if ($count & 1) -
thanks ryan - i was wondering about that - guess i should clean up my example, and pull out some of the site-specific markup, to make it a better example;
-
i've done that a lot, how you described; but i think diogo is making a good point that there's really no need to be economical in terms of # of fields or templates you use, especially if it makes it easier/cleaner
-
Getting fake URLs (with UrlSegments) returned in search results
Macrura replied to adrian's topic in General Support
note this is untested, and i haven't used clone before...but i think you are looking for something like this (though this needs help from a real php person) <?php $results = $pages->find('title|category.title%='.$config->input->get->q); $people = new Pagearray(); foreach ($results as $result) { $cats = $result->categories; foreach($cats as $cat) { $result = clone $result; $result->category = $cat; $people->add($result); } } ?> -
ok here's something pulled straight from a place i did this: <?php $gallery = $page->images->findTag('gallery'); if(count($gallery)) { ?> <!-- start gallery --> <?php foreach($gallery as $image) { ?> <!-- image markup here --> <?php } //end foreach ?> <!-- end gallery --> <?php } // end if ?>