Jump to content

Edward Ver

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Edward Ver

  1. So silly. I placed the $featured_field inside the repeater. Solved
  2. Hello. I'm learning PW and I have a Blog page which shows blog entries and a featured blog using a field. But if I use the $field featured_post=1, no page is showing. Using limit=1 works fine. <?php $blogger = $pages->find("template=blog_entry,featured_post=1"); // my template foreach($blogger as $bloggers) { foreach($bloggers->blog_entries as $blog_entry) { // my repeater field echo "<div><a href='{$blog_entry->url}'><h1 class='text-xl'>{$blog_entry->title}</a></h1>"; echo "<a href='{$blog_entry->url}'><img src='{$blog_entry->blog_main_image->getCrop('blogsmall')->url}' alt='{$blog_entry->blog_main_image->description}'></a>"; echo "{$sanitizer->truncate($blog_entry->blog_text , 100, array('type'=>'sentence', 'keepFormatTags'=>false /* true or false */))}"; echo "<p class='test_to_show_value_of_featured_filed'>{$blog_entry->featured_post}</p>"; echo "</div>"; }} ?> Any help will be very appreciated. Thanks.
  3. Thanks a lot. Very much appreciated.
  4. I have multiple layers on repeaters which must have unique or descending numbers. How do you it in processwire? I'm still new to Processwire, and it looks promising so far. I just need an auto numbering for ex: slider-layer-[Code here]. <div id="slider-layer-1">Layer 1</div> <div id="slider-layer-2">Layer </div> <div id="slider-layer-3">Layer 3</div> Thanks
  5. @Sanyaissues Thanks a lot. That works like magic.
  6. Sadly, it did not work as expected. Sorry for the confusion, but i have added the classes. Your code html output: <ul class="menu-main md:text-[16px] text-[18px]"> <ul> <!-- Loop through each child of the homepage --> <li> <a href="/laser-treatments/" class="menu_link">Laser treatments</a> <!-- Check if the child has sub-children --> <ul class="sub-menu mega-menu"> <!-- Loop through each sub-child --> <li class="menu-item-has-children"> <a href="/laser-trstments/achilles/">Achilles</a> </li> </ul> </li> <li> <a href="/kontakt-oss/" class="menu_link">Kontakt oss</a> <!-- Check if the child has sub-children --> </li> </ul> </ul> The output html should be: <ul class="menu-main md:text-[16px] text-[18px]"> <!-- If the parent has HAS child, it should output this as well. But with the child menu --> <li class="menu-item-has-children"><a href="#" class="menu_link ">Laser treatment<i class="text-lg icon-chevron-down align-[-2px]"></i></a> <div class="w-full border-t-2 rounded-md md:w-9/12 sub-menu mega-menu border-rose-600 max-w-[1280px] "> <div class="list-item"> <ul class="grid grid-cols-1 gap-1 lg:grid-cols-3 megamen--seclevel lg:grid-flow-col md:grid-rows-1 lg:grid-rows-11"> <li class="w-full"> <a class="" href="/laser-treatment/acne">Acne</a> </li> </ul> </div> </div> </li> <!-- If the parent has no child, it should output this --> <li><a href="/Contact-us">Contact us</a></li> </ul> So close...thanks.
  7. Wow, The community of PW is awesome. Thank you Sanyaissues. I will try it later and give a feedback. Thank you so much again.
  8. Hello, I'm new to ProcessWire and I love using it so far. Using Runway CMS for years, It's simply easy to use both for myself and the client. I'm almost finish with a project, but stuck on the menu. I'm not good in PHP, so I will need a bit of help. My menu structure: Home - Laser treatment -- Acne -- Etc... - Contact us HTML: <nav class="menu"> <ul> <!-- If the menu has child --> <li class="menu-item-has-children"> <!-- notice the href="#" below with no real url value --> <a href="#" class="menu_link ">treatments<i class="icon-chevron-down"></i></a> <div class="sub-menu mega-menu"> <div class="list-item"> <ul> <li> <a href="/laser-treatment/acne-kviser">Acne</a> </li> </ul> </div> </div> </li> <!-- If the menu has no child --> <li> <a href="/contact-us">Contact us</a> </li> </ul> </nav> I have tried menuBuilder, But it does not meet my menu structure. As well as MarkupSimpleNavigation. Any help will be appreciated... Thanks in advance
×
×
  • Create New...