Jump to content

Bacelo

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by Bacelo

  1. Thanks SiNNuT, that comes close but I have no idea how to set it up. I Have the following code: <?php $link_pages = $pages->get("/")->children(); // These are your top level pages foreach ($link_pages as $lp) { if ($lp->name != 'categories') { echo "<li>" . "<a href='{$lp->url}'>" . $lp->title . "</a>"; } if (count($lp->children())) { echo "<ul>"; foreach($pages->find("template=category") as $category) { if (count($lp->children("template=gallery, category=" . $category))) { echo "<li><a href='{HERE I NEED THE LINK OF THE VERY FIRST FOUND CATEGORY - VALID FOR ALL LINKS!}'>{$category->title}</a></li>"; } if (count($lp->children("template=basic-page, category=" . $category))) { echo "<li><a href='{$lp->url}'>{$category->title}</a></li>"; } } echo "</ul>"; } } ?> Regards, Bacelo
  2. Hello, I wonder if it's possible to always call/open first child url instead of parent url. F.e. (current situation): - Parent 1 /parent-1-url - Child 1 /parent-1-url/child-1-url - Child 2 /parent-1-url/child-2-url - Child 3 /parent-1-url/child-3-url F.e. (how I would like to have it): - Parent 1 /parent-1-url/child-1-url - Child 1 /parent-1-url/child-1-url - Child 2 /parent-1-url/child-2-url - Child 3 /parent-1-url/child-3-url Any ideas / help are welcome. Regards, Bacelo
  3. Thank you Wanze I'm still optimizing the layout of the generated pdf file. I got it managed to have one table for each 5 pages (pictures). I tried everything with the table width, but I can't get it done to have the tables / cells always fit to their content (pictures only) with no space left in the cells. The tables always seams to have the full page width. I have no width set for any table attribute so actually it should be fine. Any clue?
  4. Hi, I'm working on the pdf layout and do not get it managed to have several images of PW pages in line on one pdf page. I have only pages with images so the pdf file includes the images of the selected pages of the session, but they are all listed among each other. EDIT: It was a stupid question from me ... -> table layout and a simple php for loop does the job.
  5. Many thanks to both of you - by your help I was able to get it managed. I also changed the output of my navigation so the empty categories even do not show up: foreach($pages->find("template=category") as $category) { if (count($lp->children("template=gallery, category=". $category))) { echo "<li><a href='{$category->url}'>{$category->title}</a></li>"; } } Many thanks again!
  6. Hi there, I'm still trying hard to get this working but with no success... . I'm trying both ways: - filtered output for the navigation - edit output in the template as suggested by Jan Any ideas? Thanks, Bacelo
  7. This is the code in the template: <?php if(count($page->children("template=gallery, category=$input->urlSegment1")) > 0) : ?> <?php foreach($page->children("template=gallery, category=$input->urlSegment1") as $preview): ?> <div class="gallery"> <?php if(count($preview->images)): ?> <?php $count=0; foreach($preview->images as $image): ?> <div class="thumb" rel="<?php print $preview->id; ?>"> <?php $thumb = $image->height(320); ?> Thank you Jan.
  8. Jan, thank you for your reply and your help. I tried your suggestions but with no success so far. I guess I'm still to new to PW and of course my skills too low... Regarding $category->name I used this instead of $category->url because of the url structure. If I use $category->url I get "root/categories/category" which is wrong because it should be "root/parent/category" Maybe I should show my site structure: - Home - Parent 1 - Child 1 - Child 2 ... - Parent 2 - Child 1 - Child 2 ... - Categories (hidden - not used as content - used as content-filter) - Category 1 - Category 2 ... Configuration: Template "category" for categories filter option (no file) Field: "category" of type "page" -> Template of selectable page(s) "category" -> Custom selector to find selectable pages "parent=/categories/" Functionality: - Admin: While adding a new child page I can select a checkbox-filter via field "category" (all categories show up) - Page: I have a sub navigation for each parent which should show the categories - like a filter. If parent is opened, all childs are loaded. By selecting a category, only the filtered contend should show (url f.e. like parent 1/category). This is working fine so far if content with that filter exists. If an category is empty, all content of the parent is shown. So, either the category should be hidden as there are no pages with that category selected, or all categories are shown, but only filtered contend shows up at each category. Empty category = empty body. Regards, Bacelo
  9. Hello, I'm right now fighting to get content filtered by category. Maybe someone can help me... I have set up a hidden page area as filter option: - categories - cat 1 - cat 2 - cat 3 In some pages I'm able so select these categories as filters - work so far perfect. But: How can I filter the pages which have only the selected filters (categories)? I use the following code as the categories should always be shown: <?php $categories = $pages->find("template=category"); echo "<li>" . "<a href='{$page->url}'>All</a>" . "</li>"; foreach($categories as $category) { echo "<li>" . "<a href='{$category->name}'>{$category->title}</a>" . "</li>"; } ?> That shows me all the categories and a click of a category should show the filtered content - works so far but: If a category is clicked which has no pages -> no filter selected, all pages of the parent are shown instead of none. Any idea? Regards, Bacelo
  10. Hi Wanze, thanks for your reply. As PW is new to me, almost everything is not easy at the moment ... Actually I have no clue right now, how I would integrate this into the module... Additional link "Send Pdf" which renders first the pdf file, then opens a little formmailer with captcha (f.e. "Form Template Processor and Mailer") etc. and includes the pdf file. Cheerio
  11. Hi, this is a wonderful module for PW. Just need to say that - it works great! As a newbee to PW i'd like to ask, if there is a possibility, to include a "send PDF by email" option? Regards, Bacelo
  12. Hello , may I also ask another question as I'm still working on this navigation? Is it possible to show the children of a certain child (as f.e. children of all childs)? Let's say: - Child 1 (with pages) - Category 1 (Children 1 (of Child4)) - Category 2 (Children 2 (of Child4)) - Category 3 (Children 3 (of Child4)) - Child 2 (with pages) - Category 1 (Children 1 (of Child4)) - Category 2 (Children 2 (of Child4)) - Category 3 (Children 3 (of Child4)) - Child 3(with pages) - Category 1 (Children 1 (of Child4)) - Category 2 (Children 2 (of Child4)) - Category 3 (Children 3 (of Child4)) - Child 4 (hidden as used as categories option only - no pages in this area) - Children 1 (Category 1) - Children 2 (Category 2) - Children 3 (Category 3) Background info for this I'm using a field called "category" of type page. I set up the page category as child with 3 children. In the relevant child-template I have this field "category" included so I'm able to assign every new page to category. This works fine so far, as I was able to select / filter every child page by adding the categories in the url (f.e. /child-1/category-2). But I have no idea how to echo the children (Categories) of child 4 in the template to have this as navigation Any help is appreciated. (Please be lenient - I'm reading a lot in the PW docu and the forum and try do get it done and understand.) Regards, Bacelo EDIT: Would that be the right way? If so, how do I remove the /CHILD 4/ in the url to only get /category <ul><?php $categories = $pages->find("template=category"); foreach($categories as $category) { echo "<li>" . "<a href='{$category->url}'>{$category->title}</a>" . "</li>"; } ?></ul>
  13. Many thanks Diogo - this works like a charm!
  14. Finally I got it done... Many thanks to all of you for your help!!! Here is the final code: http://jsfiddle.net/dXxtD/6/ I'm more than happy
  15. I almost got it ... that's about how it should work - I still have an issue with the mouseleave / mouseout state. Still trying to egt that solved http://jsfiddle.net/dXxtD/5/
  16. Hi Diogo, this is almost exactly the way I need to have it. I got it realized yesterday evening but not as nice as your code is! Also many thanks to you and your help! The only correction I will need to do is is hide the first layer on mouse-over (f.e. Child 1) and only show the sub-childs instead. I'll post my solution here as soon as have this done. Regards, Bacelo Edit - my code from yesterday evening: $(".lp_1086").hover( function() { $(this).css("display","none"); $('#sub').css("display","inline"); } ); $('#sub').mouseleave( function() { $(this).css("display","none"); $('.lp_1086').css("display","block"); } );
  17. Hi Adrian, thanks for your thoughts. Just checked on http://www.w3.org/TR/CSS21/syndata.html#characters and you are absolutely right. Thank you for that. I wanted to use the ID number for the class to clearly control that (identifier). But I'll add a character etc. now in front. Regards, Bacelo
  18. Thanks onjegolders, here it is: http://jsfiddle.net/HENPz/
  19. Hi onjegolders, many thanks for your warm welcome and your help! Really very nice from you as I had no idea how to start... That's what I was guessing to have it realized with JS & CSS. I changed your code a bit and it works great so far : $link_pages = $pages->get("/")->children(); // These are your top level pages foreach ($link_pages as $lp) { if ($lp->name != 'ueber' && $lp->name != 'info' && $lp->name != 'pdf') { echo "<li class='{$lp}'>" . $lp->title . "</li>"; } if (count($lp->children())) { // does this page have children? echo "<ul id='sub'>"; foreach ($lp->children() as $lpc) { echo "<li class='{$lpc}'>" . $lpc->title . "</li>"; } echo "</ul>"; } } The CSS looks like: ul #sub { display: none; } #sub li { display: inline; padding: 0 5px; } So, I can now toggle via CSS the state of the parent and the child. Now I need to control that via JS - I tried the following code: $(".1086").hover( function() { $(this).css("display","none"); }, function() { $('#sub').css("display","inline"); } ); How do I control the list class? I Have no clue how to enter the relevant PW-code in the JS ... .1086 is the list class of a parent link (for test) - it should be the class of the parent link ($lp). I works with the manual entered list class (.1086), but it is not changing the state back on mouse out ... Regards, Bacelo
  20. Hello ProcessWire community, I'm brand new to this great CMS and used to work before with Joomla. I'm trying to understand more and more how ProcessWire works as I actually realize an project with it. I'm not an developer an my skills are yet restricted - I'm still learning . So far I'm doing fine until I sumbled over the navigation... I searcherd and read a lot here in the forum but I guess it would be great if someone could give an idea, the right path or a solution for what I need to realize: - Home (only an menu-icon) -> on click the next children show (got that done with a little jquery) - Child 1 - Sub-Child 1 - Sub-Child 2 - Sub-Child 3 - Child 2 - Child 3 ... -> Now, on mouseover of an child, I need the Sub-Children to show up -> toggle - Child 1 will swap to Sub-Child 1, Sub-Child 2, Sub-Child 3) but the main link remains still to parent (Child 1). Any help or ideas are very appreciated. Regards, Bacelo
×
×
  • Create New...