-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Because the option max_levels is set to 1 in the example he provided. Youd have to change it to 2 if you need two levels. Is this so hard to understand? :-P
-
Mademyday used this module the other day and got it working. I was also surpized as i didnt knew this module.
-
I didnt wanted to discuss how it should work, im with ryan here but it seems it breaks when i show actions in hover then click move while hovering. Because i cant give my clients a broken page move and i think other themes will have the same issue.
-
How to package a site to install it on another machine?
Soma replied to demhan's topic in Getting Started
Maybe theres another one in there. Or try delete cache in aessets folder. -
How to package a site to install it on another machine?
Soma replied to demhan's topic in Getting Started
Delete it manually from the modules table in mysql and try again install. -
Not really sure if it's exactly what you looking for but these should get you there. // recursively get all children from current page function getChildCategories($page=null, $level=0) { if(!$page) $page = wire('page'); $level++; $out = ''; $out .= "\n\t<li><a href='{$page->url}'>{$page->title}</a>"; if($page->children->count()){ $out .= "\n\t<ul>"; foreach($page->children as $child){ $out .= str_replace("\n\t", "\n\t\t", getChildCategories($child, $level)); } $out .= "\n\t</ul>\n\t"; } $out .= "</li>"; if($level == 1) return "<div><ul>$out\n</ul>\n</div>"; else return $out; } echo getChildCategories(); And from your point 3. "has_parent" is the key here I think to find all children recursively from a certain page, then get all posts that has at least one of those selected // get all children categories of a parent and get most recent posts from all those function getChildCategoriesPosts($page=null) { if(!$page) $page = wire('page'); $out = ''; $categories = wire("pages")->find("has_parent=$page,template=category"); $posts = wire("pages")->find("category=$categories, sort=-modified, limit=10"); if($posts->count()){ foreach($page->children as $child) $out .= "<li><a href='{$child->url}'>{$child->title}</a></li>"; } else { return "<li>No Posts found/p>"; } return "<div><ul>$out</ul></div>"; } echo getChildCategoriesPosts();
-
I haven't done so much with repeater but this gave me the value I needed. // find pages with a certain value in one of the fields of a repeater item. $found = $pages->find("myrepeater.field2=foo"); echo "found: ".count($found); foreach($found as $f){ // find the repeater item field2 with value foo $r = $f->myrepeater->find("field2=foo")->first(); echo $r->field1; } Depends what field values and type you have, but this does work.
-
Oh of course it does work with title if the title is written same as the page name, because name works. Most of the time my title are different from the name, mostly uppercase letters or some more words.
-
Actually it really doesnt work with title of pages. At least for me. The label displayed has nothing to do with how it's compared i thougth.. it's only what is displayed as the label in the select. $page->path does work for example. PageArray or Page get converted to pipe separated id string in a selector 1233|1231|3232 which is just saying one of those id's.
-
Oh and I think this is stilla bug that's there's since a long time, but maybe it's only me that I think PW should be kind enough to solve it for us, when changing and saving the field.
-
Page field can be used with many sort of inputs I think, ids, objects, name... best is you can also use a PageArray too and it will magicly select multiple pages that have at least one of the pages in the array selected. But title doesn't work here, you're definately doing something wrong elsewhere. If you say both works same, I'd guess you're looking at wrong window It's strange to see you using title to compare, as I think it's one that's one that would not be so save, as when you change title the name field doesn't change and title isn't unique. The only way I can reproduce your behaviour is when changing a single page field to page array, then save 2 different entries and change field back to single. This does save two id's in the field db table, page_id and data is the reference. Now there's case it can have two entries in db even the page field should only hold one, then in the code you have it would find both. This can only be corrected when selecting the empty and save the page. Otherwise it will stay there hidden.
-
In my theme I have changed CSS to show page actions when hovering the row. Now there seems to be a little issue with then I hit move when the page is not selected yet, I can't move the page. I then press cancel and hit move again and it works. It only works when the page is open but not when closed. I'm not sure why that is but found it surprising.
-
There's an 500 server error shown (white page) when I select the page itself in a page field and save page. Could this be avoided?
-
Is it insider a repeater or anything you found out? Have you chance to install on different machine that could help further?
-
It works already. Have you changed an imagr field to a crop image?
-
Yes its the thumbnail official module thread. On mobile so too lazy to link to
-
We are trying to find out in the Thumbnails thread. It's not working when setting up a cropimages and not saving the field afterwards. The default settings doesn't get recognized (and saved in db). Only after saving the field again it starts working again. At least for me.
-
And if you reload the page is there the image ort not? Have you got a empty new line.. I dont know. It is working fine here now. :-/
-
Try to find czech translation as i think its the most complete regarding files. But youd have to create your own just for knwing which are there. You could also use grep or file search to search for patterns of the __() and $this->_() functions.
-
Got same issue here. Once I saved the field again it worked. Seems like the default value "thumbnail,100,100" doesn't work when calling it from FIeldTypeCropImage.module #55 https://github.com/apeisa/Thumbnails/blob/master/FieldtypeCropImage.module#L55 returns empty. The error is also from there few lines down.
-
Got same issue her on my local install with 2.2.13
-
There was exactly same question 1 week ago... ok again http://processwire.com/talk/topic/2584-numchildren-vs-children/?hl=%2Bnumchildren+%2Bcount $page->numChildren returns ALL children count. count($page->children); //or $page->children->count(); return only viewable pages by the user, which mean NOT: unpublished, hidden or non-accessible pages.