-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
@n0sleeves No you're not doing anything wrong. As I said I didn't test this, just thought it would work. I found it's not working the way I thought with a page field "pagefieldname.url". MarkupSimpleNavigation uses the $page->get("fieldname|otherfieldname") method to get values, and subfields don't seem to work here. So I just went and added this feature so you can now in 1.1.8 use page fields like 'redirect_page' (without url) and it will detect it's a page and spit its url. To make it work the page field has to be set to "Single Page or false". 'item_tpl' => '<a href="{redirect_page|url}">{title}</a>' This is now in pushed and available on modules repository.
-
My example has no include. Its more of a controller render a partial view. I just corrected my code as said earlier. This is a little cleaner and maintainable code than what you have. Also a minor point is that $key is zero based, so a $key+1 would make it behave first odd 1,2,3,4 rather than first even 0,1,2,3. (Not really a matter, just depends what class you set for odd and even.) Edit: you got the fault copied from my example.. the html is outside foreach.
-
My example has a fault. The template render part should be in the foreach... Im on mobile so if someone with edit right sees this. Thx.
-
kongodo, this is just a temporary property set to the page object. $page->somevalue = 123; echo $page->somevalue; // 123
-
I personally would code it like this is a more simple way: $randomTesties = $pages->find('template=testie, sort=random, limit=10, id!='.$page->id); // always test if anything found or you'll end up with empty markup or errors if(count($randomTesties)){ foreach ($randomTesties as $key => $testy) { // short version of what shown before $class = ($key % 2 == 0) ? 'testiecolalt' : 'testiecol'; $testy->altclass = $class; // temp save class to the page object $testy->template->filename = $config->paths->templates . "views/testy.php"; // set template file echo $testy->render(); } } And the template view: <!-- template file /views/testy.php --> <div class="<?php echo $page->altclass; ?>"> <div class="testie"><h4><?php echo $page->testie_header; ?></h4> <div class="testiequote"><?php echo $page->body; ?></div> <h5><?php echo $page->testie_name; ?></h5></div> </div>
-
I tested again in different installs a little after your post and it partly works, but when using parent.title in the fields title|parent.title%=space I get the space parent and all it's children ... but NOT other pages outside that parent that have space in it's title. Hope that makes it clear. It's like AND and not OR.
-
That's not correct. Nothing you do will get overwritten on update you just replace /wire/ folder, unless you modify something in there you're save to change whatever template you wish and it will stay there.
-
$config is WireData so you could $config->minify = new WireData(); $config->minify->set("test","hello world"); Or use an php array and set it to the minify config $minify = array(); $minify[] = 'test'; $minify[] = 'world'; $config->minify = $minify;
-
HelperFieldLinks module is your friend. Unleash the power!
-
OMG Ryan beat me to it!
-
Basicly, you can just change language of user and call $page->url $language = $user->language; //save current lang foreach($languages as $lang){ // cycle languages $user->language = $lang; // switch user language echo $lang->name . ' : ' . $page->url . '<br/>'; // echo url } $user->language = $language; // put back current language There's other way with new LanguageSupportPageNames module you could get a language urls of a certain page $page_names = $modules->get("LanguageSupportPageNames"); $de = $languages->get("de"); echo "de url: ".$page_names->getPagePath($page, $de);
-
A good developer knows every ID of his pages by memory.
-
Only the green thing.
-
So, back with the result of my investigation. I finally found the problem. As the data in the website is mostly imported from a file html export we get from another company. Turns out they had special chars in a file name (even after telling them for the third time). I didn't notice until now. 002.coñt_de_lendettement_financier_net.htm The imported page is ok, as the name generated does replace ñ. Now there a link in tables that would open a modal loading the body of this page, and the url from he exported html was: 002.coût_de_lendettement_financier_net.htm The path to this page goes to a ajax.php bootstraped and there's a wire("pages")->get(path..) and calling it with the û it throws the error I posted.
-
Hi roy, there's no password protection for any files in PW. Can you tell a little more what you're experiencing?
-
@mike thanks for the heads up. Since you found the root of the cause, could you let the admin theme developer know that it's not working? http://processwire.com/talk/topic/1856-release-ergo-admin-template/
-
Just wanted to add that parent=1006|1003 will only give direct children of those two pages and not recursively all children and grandchildren... So once you get on 3rd level it will stop. This may not an issue just a limit of this use. There's a select field has_parent=1006 which does include all that are in that parent with all subchilds, though it doesn't allow for multiple only one ID. So going templates or checkbox way is most flexible and solid solution. Edit: you could work around the limit also with something like this (being creative) <ul class="nav"> <?php echo $nav->render(array('selector' => 'id|has_parent=1006', 'outer_tpl' => '||' )); // outer ul empty ?> <?php echo $nav->render(array('selector' => 'id|has_parent=1003', 'outer_tpl' => '||' )); ?> </ul>
-
Great work and thinking. Shouldn't the calls be camel case imRotate() ?
- 32 replies
-
- 1
-
- manipulation
- imagesizer
-
(and 3 more)
Tagged with:
-
From in this thread http://processwire.com/talk/topic/2768-processwire-23-testing/?p=30475
-
Uppps I posted this from mobile and my mind was in another thread of mine... So ignore my post!
-
Latest PW. Nothing special, no matter from where iI call the find. Not sure what else to say. I will test with another install again. Wrong thread! Sorry.
-
To select another fieldgroup for a template is only available in advanced mode.
-
Is that test with multilanguage fields? I can't get it to work, even when I tried from a template. The module I tried to get it to work is ImageManager, but I did remove the parent.title at the end since it's also not really needed.
-
I just pushed an update to 0.0.2 to github. Some refactoring and some changes - changed image tag syntax to use selector string syntax. This is easier to handle and I can use the PW selector class to read key=value easily. Now supports: {image=/path/, width=200, height=200, class=someclass, id=myimage, rel=album} - improved image upload to use the image field settings for max size settings, also improved error handling there- added some translations string - changed data table some and added a input for the tag where when you click it will select the tag text automatic for easy copying. - added modified date (sortable), also fixed some stuff with sortable of other cols - added size col - improved data table live search to search for also image description or image description field and title Planned - improve upload even more if/where possible - add easy image delete function - (Done) add textarea fields setting, to only insert "ImageManager" button to those specified Any testing or help appreciated. Thanks
-
You can enable advanced mode in config.php and then create a new template for childs. Under the fieldgroup list you see now a fieldgroup select from another template. Chose basic-page and youll have a reference. Set family settings how you need and unde advanced tab look for alternative template setting and enter basic-page. Now it uses same template file.