Jump to content

doolak

Members
  • Posts

    319
  • Joined

  • Last visited

Everything posted by doolak

  1. I have no doubt that you will! I have another little question... In the news-template i have set the news to be sorted by date: $stories = $page->children("limit=3, sort=-date"); If two articles are created the same day the last created is placed below the first created. I only found the solution to set the sort field on the page settings to created, but then this setting will be overwritten by the template. Is there a possibility to set two parameters in the template (date and created)? Another thing is that i wondered why "date" is not shown in the sort field - is this changed in PW 2.1? I just ask because you commented the code above: --- Ok, got it - i just made a mistake when i tried to add "-created" to the template, i did it like this: $stories = $page->children("limit=3, sort=-date,-created"); but i had to do it like that: $stories = $page->children("limit=3, sort=-date, sort=-created"); So now its working fine. Would maybe be a nice thing, if the sort field in the settings would allow multiple sort parameters too, or not? But as we can sort pages in the template it seems to be just an addition that you can set the sort field in the page settings - or are there any scenarios where it's better to use the page setting to sort them? Ah, and i still couldn't find out why "date" is not shown there.
  2. I had just to save those pages again - no problem. And thanks again for the help - it's great to have such a fantastic support here! BTW: After a few days testing around with PW i have to say that i am so happy that i have found this great system - i have tried out so many CMSs in the past few years and after i have spent few days now again with searching for a flexible system which supports custom fields i cannot think of any other system which fits my needs better! Thank you very much for that great peace of software! --- And although i knew already about the flexibility, again and again i am impressed how flexible and well-though-out this CMS is: i just discovered the template setting "List of fields to display in the admin Page List" - that will help my clients to work with the news-section much more comfortable...
  3. Hello again... While setting up a newspage i discovered that all newsitems are listed as sub-pages in the multilevel-menu. I tried to avoid this by excluding the news-template in the modified code from above: <?php function treeMenu(Page $page = null, Page $rootPage = null) { if(is_null($page)) $page = wire('page'); if(is_null($rootPage)) $rootPage = wire('pages')->get('/'); $out = "\n<ul>"; $parents = $page->parents; $children = $rootPage->children; if($rootPage->id == 1) $children->prepend($rootPage); foreach($children('template!=news') as $child) { $class = ''; $s = ''; if($child->numChildren && $child->id > 1 && $parents->has($child)) { $class = 'active'; $s = str_replace("\n", "\n\t\t", treeMenu($page, $child)); } else if($child === $page) { $class = "active"; if($page->numChildren && $page->id > 1) $s = str_replace("\n", "\n\t\t", treeMenu($page, $page)); } if($class) $class = " class='$class'"; $out .= "\n\t<li$class>\n\t\t<a href='{$child->url}'>{$child->title}</a>$s\n\t</li>"; } $out .= "\n</ul>"; return $out; } echo treeMenu(); ?> but i get the following error: Without the part "('template!=news')" everything works fine - just the second level from news is shown. Kind regards, Christian --- Update: Found a solution - i changed this part: $children = $rootPage->children; if($rootPage->id == 1) $children->prepend($rootPage); foreach($children('template!=news') as $child) { to this: $children = $rootPage->children('template!=news_article'); if($rootPage->id == 1) $children->prepend($rootPage); foreach($children as $child) { So the excluding syntax only works when its used in a $abc->xyz context or would there be another way to have the exclusion in the "foreach($children as $child)" - part?
  4. I had only 2 childpages and have set the limit to 1 - so the total number of pages was bigger than the limit. But it seems that it works only if you have minimum 3 pages and set the limit to 2. So at least it works now, thanks! Another thing that appeared is that the date shows always " 31/12/1969 19:00" if i doesn't input anything. I am using the datepicker and have set "use todays date" to active. Any idea what could bw wrong?
  5. Hi there! I am trying to build a news page like Ryan described in his first example above, but i cannot get the pagination to work - it is not shown (see attached file) I have the both required modules installed (they were already installed in PW 2.1). Any idea what could be wrong? I have read about pagination in the doku and the forum, tried different things out - but the pagination does not appear... Kind regards, Christian
  6. Yep - that did it! Thank you very much for the quick help again! And: Congratulations to your 1000th post... ;-)
  7. Hm, still not working... To be sure that i did it right, here's the code: <?php function treeMenu(Page $page = null, Page $rootPage = null) { if(is_null($page)) $page = wire('page'); if(is_null($rootPage)) $rootPage = wire('pages')->get('/'); $out = "\n<ul>"; $parents = $page->parents; $children = $rootPage->children; if($rootPage->id == 1) $children->prepend($rootPage); foreach($rootPage->children as $child) { $class = ''; $s = ''; if($child->numChildren && $child->id > 1 && $parents->has($child)) { $class = 'active'; $s = str_replace("\n", "\n\t\t", treeMenu($page, $child)); } else if($child === $page) { $class = "active"; if($page->numChildren && $page->id > 1) $s = str_replace("\n", "\n\t\t", treeMenu($page, $page)); } if($class) $class = " class='$class'"; $out .= "\n\t<li$class>\n\t\t<a href='{$child->url}'>{$child->title}</a>$s\n\t</li>"; } $out .= "\n</ul>"; return $out; } echo treeMenu(); ?>
  8. Hello there, thanks for that snippet - helped me to make my multilevel menu working! (Although i don't understand the entire code yet...). I have just one little problem: my homepage ("Home") - the root of the website is not shown in the menu - do i have to add that or should it be displayed with that code-snippet? Kind regards, Christian
  9. OMG - and i was trying to modify that in the module... Great, so its possible to have different fields with different TinyMCE buttons... Thanks for your quick answer"
  10. Hello there, i need to add a button to the TinyMCE toolbar - i tried this by modifying InputfieldTinyMCE.module, but no button appears. Is it possible to change the settings in that file or do i have to do this somewhere else? Kind regards, Christian
  11. Thanks - works fine - exactly what i was looking for!
  12. Hy ryan, i guess not - because i downloaded the newest commit yesterday...
  13. I discovered a strange behaviour: If you select one page and another and then click "move" at both pages, the links are duplicated - if you click more often they will be again and again duplicated. I thought it was a bug which appeared because i am using a module for translating the backend, but then i tried it in the demo and the same problem appeared (see attached screenshot).
  14. Hello there, i want to use the first page of a pagetree as a "section header" which isn't shown on the website and doesn't have any content or settings which should be edited by the client - so i want that it doesn't show the "Edit", "View", "New" and the "Move" links. I use a special "section"-template for this purpose - so i can restrict access for this this group and don't allow editing and adding pages - but it's not possible that i deselect "View Pages". It would be nice to have all links hidden and use that page just as a "section header" in the pagetree (f.e. "global preferences" or "partners", when there is no "partner" page but partners has to be listed somewhere else). Is there such a possibility somehow? If not, what do you think about hiding the "View" link from a group which has no access to edit a page (if i cannot edit a page i will hav no reason to view it from via a link from the backend)? Kind regards, Christian
  15. That sounds like a good idea - if the superadministrator could decide if a page allows managing access or not. So one could define that for a pagetree with hundreds of pages (like "Cities" in the Skyscraper example) the client can manage access to the root-page of that tree, but not to all children - and avoid that there are hundreds of different permissions for all those cities. But, if it would be necessary - f.e. if there are lots of hotels listed and each hotel should be administred by a different person (hotel manager), one could define that on each of those pages one could manage access...
  16. Yes, i can imagine that its very difficult to find a solution which fits everybodys needs and to all situations... Maybe a combination could be nice: a template-based permission system with the additional possibility to add page-based permissions for groups and/or users by including or excluding their access to that page or pagetree. So you wouldn't have to use 20 similar templates for 20 different pages when there are 20 different users which should have access to just one of those pages.
  17. Hello there, i think it wouldn't be bad if it could be possible to give a specific usergroup (and maybe a specific user too) the possibility to edit that page by changing this in the page settings. In the moment just someone who know how to add a new template would be able to do this - he would have to add a template where that one group or that one user has access to edit it. That would be too much for most of the typical administrator. Maybe with the option to choose, if this inherits to children or not. What do you think about that? Would that interfer somehow with the actual permission system or would that be possible? Kind regards, Christian
  18. Yes, that works fine - if one add the backslashes, just in one case it didn't: 'id=\'ProcessPageEditChildren\' title=\'Children\'' => 'id=\'ProcessPageEditChildren\' title=\'Unterseiten\'', I guess it has something to do with the fact that - i dont't know why - the title "Children" is wrapped in <em></em>. I have tried to add this to the code above but i couldn't get it work.
  19. Well i guess the best for such cases is to put all required fields together in a template and work with one page "per item" - in most cases (like the skyscraper example) this would be the nicest way - just for a few images which has to be shown on the homepage (and a related text for each image) it would be nicer to have the possibility to edit this on the homepage. But it would be fine to add a page "Slider Images" below "Home" or have an extra "Meta" area, where one can collect different global settings, like Apeisa suggested.
  20. Hm, that doesnt work for me - there is still one "Description" field shown when i edit the page. Here's my code: <?php foreach($page->images as $image) { $large = $image->width(261, 157); echo "<li>"; echo "<div class='inner-banner'>"; echo "<div class='screen'>"; echo "<img src='{$large->url}' alt='' />"; ?> <h2><?php echo $large->description[0]; ?></h2> <p><?php echo $large->description[1]}; ?></p> echo "</div>"; echo "</div>"; echo "</li>"; } ?>
  21. Yes, that could be a good option - that "Root" - thing seems to be not very good idea... Maybe one time there will be repeatable regions in which one can collect some fields - that would be a very nice addition. --- As i saw now there is a fieldtype called "Fieldset" - i just tried it out now and i ask myself if this couldn't be a good starting point and if it will be possible to make it repeatable.
  22. Hello apeisa, thanks for your answer! Yes, i guess this will be the only possibility as long as repeatable regions are not supported - technically should be no problem, like you said: the PHP code will be almost the same. Just would have been if those images could be simply added to the homepage by editing "Home". I am no figuring out how i can sort pages in the page tree the best to have such page-specific feature shown up as child of the related page - something like this would be nice: Root - Home - Slider Images - About - Gallery - Gallery 1 - Gallery 2 - Gallery 3 - Contact That would make it little more structured for the editor, because he can see that the images belong to the homepage. Right now i am checking out if its possible to set such a "Root" page which is not shown as frontpage...
  23. Hello Adam, Yes, thats right - i just did not see that... Thank you for your help. You are talking about the "Description", right? Would be a possibility for a short slogan, yes - but i need some more text, so a textarea would be better. So if i want to setup my own set of fields, i have to use a page and a template to assemble them, right? Or build a special fieldtype module... That's a pity - because it would be so nice to have the images listed like its done in the PW example page. Repeatable regions would be the solution - maybe a feature for future releases...
  24. Hello there, for a current project it would be necessary to add some pictures which are shown on the homepage slider. First i thought i just have to do it similar to the PW example homepage - but i need one textarea to be added to each picture... How can this bis solved? I just have the idea of the following solutions: 1. Writing a new fildtype which has such a texarea 2. Use an extra page and template for those pictures - but here i would have the possibility to choose just one image and i just discovered that it seem not to be possible to restrict the upload to just one image - dont know if i am right or i just missed something... Any other idea? Kind regards, Christian
  25. Yes, works fantastic! Great! I dont know if the same "problem" appears in the "Edit page" "Wire Tabs" - i couldnt get the JSON output for that part with Firebug and so i couldnt change those expressions in the same way with: '"name":"Content"' => '"name":"Inhalt"', If you could provide me the JSON output i will try and let you know if there has to be changed something too. --- I had a deeper look and now i am not sure if this part is generated with JSON but the Wire Tabs seem to be generated via jQuery after "Page::render" - so str_replace does not hook into the code... not sure if i am right. --- For now i have found a - not very elegant - way to solve this problem - I have changed the path and id again with str_replace to the original expressions: 'ProcessPageEditUnterseiten' => 'ProcessPageEditChildren' So if its not important for future translation you dont have to dig into the code - for me it works fine for the moment.
×
×
  • Create New...