Jump to content

Peter Knight

Members
  • Posts

    1,377
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Peter Knight

  1. @Soma Slightly off topic but is your Avatar taken from the original Unreal game for the Mac?
  2. That would/should work and it'd mean shorter anchors as some of my names are 20 words long :-/
  3. Foundation (and Bootstrap) don't really care what CMS you use once you can adhere to their CSS. Likewise, a good CMS such as PW doesn't care what responsive framework you choose either. Customer reviews Is that currently a WordPress widget which then pulls in the G+ reviews? social share Have you looked at some of the off-the-shelf social widgets such as http://www.addthis.com/ ?
  4. This is very interesting to me. I got it working. I'm not sure if its Foundation which doesn't like having an integer as the target or wether it's a PW issue. In the end, I had to switch to name <a href=\"#{$faq->name}\">{$faq->title}</a> instead of id <a href=\"#{$faq->id}\">{$faq->title}</a> Here's my full code. I'm not using an active class but that doesn't matter right now. <?php echo "<dl class=\"accordion\" data-accordion >"; $faqs = $pages->find("template=faq-detail"); foreach ($faqs as $faq) echo " <dd class=\"accordion-navigation\"> <a href=\"#{$faq->name}\">{$faq->title}</a> <div id=\"{$faq->name}\" class=\"content\"> {$faq->faq_body} </div> </dd> "; echo"</dl>" ;?> Hopefully someone else will have the same issue and find this thread
  5. Because my page names are based on FAQs, they resulted in massive URLs so I stuck with the ID method. Nice to have so much flexibility though.
  6. Yep. Pulling in the ID and applying it to each FAQ. I also tried some raw code from the Foundation site and can confirm the toggle actually works and the Toggle.JS is working on that page.
  7. I was just wondering the same My faq->id is working and my echos are er, echo'ing but clicking on an Q doesn't toggle the A right now.
  8. @Joss They're quick alright. If you look at the "who's reading this topic", they're like seagulls on a hot chip variable in summer.
  9. Of course! There's me assuming it needs to be complicated :-/ I had tried page->title but that was massive. Hadn't thought of ID as I only use them in MODX
  10. Im working on an FAQ section for a client. It's using Foundations Accordian JS so you click a Question and it toggles the Answer. You know the deal. The tricky part for me is when looping through my FAQs, I need to assign each anchor and target div with a unique number. Been trying to set a variable at one and then incrementally add a number per each FAQ. Wondered if my syntax was wrong or if there are more basic issues with the $x=1 idea. <a href='#$x++'>{$faq->title}</a>; <div id='$x++' class='content'> My working code (apart from the $x++) <?php $x=1; // Start a fairyball at 1 $faqs = $pages->find("template=faq-detail"); echo "<dl class='accordion' data-accordion>"; foreach ($faqs as $faq) echo " <dd class='accordion-navigation'> <a href='#$x++'>{$faq->title}</a>; <div id='$x++' class='content'> {$faq->faq_body} </div> </dd> "; echo"</dl>" ;?>
  11. Agree. I think you're all nuts. Thankfully I'm not allergic to nuts. Here's another thing my old boss used to say to me : "Pete me auld flower. That's not just allowed. That's in fact encouraged". Stay nuts
  12. @GuruMeditation The tone of this thread could rapidly diminish!
  13. Yep - You just bet me too it. I eventually tried creating a variable first and then passing the value to the echo thingy. BTW, re. variables - my wife came into the office yesterday and I must have looked particularly grumpy. The conversation went kind of like this: Her: whats wrong? Me: oh...just bloody variables Her: Bloody fairy balls? I thought you were having ProcessWire problems! Well, it made me laugh and got rid of my grump.
  14. I have an image field as follows: Max files allowed = 1 Formatted value = Automatic Inputfield = cropimage If I follow the instructions here, this needs to be my echo call <?php echo $page->photo_for_course->getThumb('crop-for-course-detail'); ?> But this just outputs the fullpath as a string. The documentations states that "getThumb returns url to the thumbnail you have asked for". So I then thought I needed to tag an ->url on the end as follows <?php echo $page->photo_for_course->getThumb('crop-for-course-detail')->url; ?> It's not a first() issue as the file only allows for one image so Im a bit stuck. I've achieved this before but was using the $pages API and had a foreach loop. Surely I don't need to foreach here as I'm only using a single image? Thanks in advance. I feel like it's you guys that are building this site :-/
  15. Thanks Adrian. In this instance there are multiple values so all is cool in looping land.
  16. Making progress. Because each field must be an array, it appears I do need to loop through each. This is working but perhaps not the way I *should* be solving it <?php $course_level = $page->course_detail_level; $course_category = $page->course_detail_category; $course_grouping = $page->course_detail_grouping; $course_prerequisite = $page->course_detail_prerequisite; $course_writer = $page->course_detail_writer; $course_lessons = $page->course_detail_lessons; foreach($course_level as $level){ echo "<strong>Level:</strong> {$level->title}";} foreach($course_category as $category){ echo "<strong>Category:</strong> {$category->title}";} foreach($course_grouping as $grouping){ echo "<strong>Grouping:</strong> {$grouping->title}";} foreach($course_prerequisite as $prereq){ echo "<strong>Prerequisite Course:</strong> {$prereq->title}";} foreach($course_writer as $writer){ echo "<strong>Writer:</strong> {$writer->title}";} foreach($course_lessons as $lesson){ echo "<strong>Lessons:</strong> {$lessons->title}";} ?>
  17. On the National Geographic case study, I found it interesting that the developers moved the whole site to ProcessWire in the background and *then* brought this up with the client. Had they asked if they could move from Drupal to PW, the answer would likely have been negative. Perhaps a risky strategy for some but as my old boss once said: "Ask for forgiveness. Don't ask for permission"
  18. I've created several fields and want to output their values on my page. Normally, the following works fine <?=$page->field-name-here?> For my latest fields this doesn't work and is instead outputting an integer (which I imagine is the page number). <h4>Course Details</h4> <strong>Level:</strong> <?=$page->course_detail_level->title?><br /> <strong>Category:</strong> <?=$page->course_detail_category?><br /> <strong>Grouping:</strong> <?=$page->course_detail_grouping?><br /> The above fields are mostly all based on a Page type and then an input field type of AsmSelect. I imagine my issue is that I am therefore dealing with an array and need to create a foreach statement?
  19. I have 12 fields set to 33% width and although 3 of them are the correct size, nothing will sit to their right (in the 2nd and 3rd column). This happens to the first field on every second row of fields. Checked the database value for the fields and they're definitely 33%. The wierd thing is, if I set it to 10, 20 or 30%, they behave in the same way. Wierd glitch or known bug? Or maybe my maths is crap :-/
  20. @SiNNuT Image fields can hold multiple images (a WireArray) so I need to specify which exactly which image I want to call. Got it. Getting the tatoo on my face next week
  21. Adrian - thanks. I've only spent 5 hours trying to solve this and a couple of hours on the forums.
  22. Definitely need to go back to PHP junior school Do I need to create a separate variable for the first image and then call that in my echo statement <?php $graduates = $pages->find("template=graduate-detail, sort=-date"); $myfirstimage = $pages->graduate_photo->first(); foreach ($graduates as $graduate) echo " <img src='{$myfirstimage->url}' /> <h3>{$graduate->title}</h3> {$graduate->graduate_summary}<br/> <a href='{$graduate->url}'>Read more</a> <hr/> " ;?> Above doesn't work but I think Im on the right track
  23. I did but it didn't fix anything. Actually, it outputs the complete path to my image except the actual image name <img src="/my-pretend-site.com/site/assets/files/1093/">
  24. I'm trying to output a series of photographs onto a index page. Each photo is from a different page so I'm using the $pages API. Everything is working bar the image and link to the main Graduate detail page. My PHP call <?php $graduates = $pages->find("template=graduate-detail, sort=-date"); foreach ($graduates as $graduate) echo " <img src='$graduate->graduate_photo->url' /> <h3>{$graduate->title}</h3> {$graduate->graduate_summary}<br/> <a href='{$graduate->url}'>Read more</a> <hr/> " ;?> What's happening Instead of outputting a JPG from a field called graduate_photo, i'm left with the following: <img src="graduate-hazel-scully.jpg->url"> As you can see, the image name is correct but the path is incomplete. It's outputting the '->url' too for some reason. I've red thorugh the PW images documentation so I'm not sure what my issue is. Possiblt it's because the docs are mostly giving examples where an image is called from the $page instead of $pages.
  25. Thanks guys. I'd prefer to use HannaCode here too. Much less to type for starter.
×
×
  • Create New...