Jump to content

Jon E

Members
  • Content Count

    43
  • Joined

  • Last visited

Community Reputation

5 Neutral

About Jon E

  • Rank
    Jr. Member

Recent Profile Visitors

2,067 profile views
  1. Thank you so so much @abdus!
  2. Hi, Been scratching my head on this one all day - I have a function to find if my current page is referred to in other pages, which is working fine, but I want to only output the section if there is content to go in there, i.e. I wouldn't want to show the 'events' heading or div if there are none. I know this should be quite straightforward but I've been looking at this for a couple of days and stuck on it, so any help would be really great. Thanks so much. <div class="written_list_participant"> <h2>Events</h2> <ul> <?php $fe = $pages->find("contributors=$page, template=event"); // $page is the current page foreach($fe as $e){ echo "<li><a href='{$e->url}'>$e->title</a></li>"; } ?></ul> </div>
  3. Hi, Running into some issues with this myself - I have multiple pages referenced and want to output the title of these pages - works when I have a single page option but either getting the ID's (i.e. 1144|1089) or nothing when I try to call title... can someone help me? Sorry, have looked around a lot but just not getting the concept! Thank you very much. <?php if ($page->children) { foreach($page->children as $selectedthumbs) { echo "<tr><th><a href='{$selectedthumbs->url}'>{$selectedthumbs->title}</th><th>{$selectedthumbs->contributors}</th></</tr>"; }} ?>
  4. Hi, Thanks so much - that makes sense... I've tried to combine the below in a lot of different ways but keep getting an error... Any ideas? Thanks <?php if ($image->caption){ //Output markup 1 } else { //Output markup 2 } ?> <?foreach($page->images as $image) { $thumb = $image->width(1040); echo "<li><img src='$thumb->url' alt='$image->description'><p class='caption'><strong>{$image->imagetitle}</strong> <em>{$image->imagetext}</em> <span><br>{$image->role}</span></p></li>";} ?>
  5. Hi there, Little stuck on something and have looked around. I have used the image field extender module but when I'm outputting images in my gallery I want to check if there is a caption before I output the markup. How would I go about this? Thanks echo "<li><img src='{$thumbnail1->url}' alt='{$image1->description}' /><p class='caption'><strong>{$image1->imagetitle}</strong> <em>{$image1->imagetext}</em> <span><br>{$image1->role}</span></p></li> ";
  6. Hi there, Am really stuck on this one and I had a look around but couldn't work this out still. I have a repeater field (screenshot attached) - and I want to run a command such as: <?php echo $page->homepage_media->getRandom()->video_strip_1->url ?> <?php echo $page->homepage_media->getRandom()->video_strip_2->url ?> <?php echo $page->homepage_media->getRandom()->video_strip_3->url ?> <?php echo $page->homepage_media->getRandom()->video_strip_4->url ?> <?php echo $page->homepage_media->getRandom()->video_strip_5->url ?> So I want all random links output individually but all from the same repeater entry. Does that make sense? Sorry would appreciate any help.
  7. Hi, Sorry to ask again, I have tried so much but I want to be able to post entries without a thumbnail. I know the 'if' statement is probably wrong below but what am I doing wrong? Thank you <?php foreach($page->children("template=blog-entry") as $key => $post) { if($key == 2){ // Render static content after 2 posts echo"<div class='grid__item cat1' id='blog_listing'><div id='tweet'></div><div class='clear'></div><div class='hide'><button class='action--buy'></button></div></div>"; } // let's grab the project thumbnail and resize it $image = $post->blog_thumbnail; // get the first image $thumb = $image->size(1000); echo "<a href='{$post->url}'><div class="; echo"'grid__item cat"; echo $post->get("blog_category"); echo"' id="; echo'"blog_listing'; echo'"'; echo">"; if(count($post->blog_thumbnail)) { echo "<img src='{$thumb->url}' alt='{$album->title}' />"; } echo"<div class='blog_listing_meta'>"; echo"<h2><strong>"; echo $post->get("title"); echo"</strong><br/>"; echo $post->get("date"); echo"</h2>"; echo"</div>"; echo'<div class="hide"><button class="action--buy"></button></div>'; echo"</div></a>"; } ?>
  8. Hi, Sorry thanks for helping and I might be being an idiot but if I do: <?php foreach($page->children("template=blog-entry") as $key => $post) { if($key == 3{ // Render static content after 3 posts echo"<h2>static block</h2>"; } // let's grab the project thumbnail and resize it $image = $album->blog_thumbnail; // get the first image $thumb = $image->size(1000); echo "<a href='{$album->url}'><div class="; echo"'grid__item cat"; echo $post->get("blog_category"); echo"' id="; echo'"blog_listing'; echo'"'; echo">"; echo "<img src='{$thumb->url}' alt='{$album->title}' />"; echo"<div class='blog_listing_meta'>"; echo"<h2><strong>"; echo $post->get("title"); echo"</strong><br/>"; echo $post->get("date"); echo"</h2>"; echo"</div>"; echo'<div class="hide"><button class="action--buy"></button></div>'; echo"</div></a>"; } ?> I get: Parse Error: syntax error, unexpected '{' (line 25 of C:\MAMP\htdocs\dev\site\assets\cache\FileCompiler\site\templates\blog-listing.php) This error message was shown because: you are logged in as a Superuser. Error has been logged.
  9. Hi, I have looked around a few places but I couldn't find a solution here so wondered if someone could help me here. I am making a listing page for blog items, but need to interrupt the listing after a few posts (to be decided how many) with a static div (that will pull in the most recent tweet). Could someone help me with how to 'inject' this into my foreach loop? Hope this makes sense and thank you. <?php foreach($page->children("template=blog-entry") as $album) { // let's grab the project thumbnail and resize it $image = $album->blog_thumbnail; // get the first image $thumb = $image->size(1000); echo "<a href='{$album->url}'><div class="; echo"'grid__item cat"; echo $album->get("blog_category"); echo"' id="; echo'"blog_listing'; echo'"'; echo">"; echo "<img src='{$thumb->url}' alt='{$album->title}' />"; echo"<div class='blog_listing_meta'>"; echo"<h2>"; echo $album->get("title"); echo"<br/>"; echo $album->get("date"); echo"</h2>"; echo"</div>"; echo'<div class="hide"><button class="action--buy"></button></div>'; echo"</div></a>"; } ?>
  10. Hi, It does, and I'm getting just the filename.jpg output... not the whole directory. Thanks Jon
  11. Hi, Could someone give me a helping hand please? I have the below code: <?php // Show the gallery widget if there are slideshow images attached to this press article if(count($page->slideshow_images)) { echo '<div id="article_slideshow_widget">'; $n = 0; echo "$page->images->first()->url;<img src='http://i.imgur.com/0heduk5.png' class='article_slideshow_widget_zoom'></div>"; $n++; } echo ""; ?> I want to output the first image from the images field in the article_slideshow_widget div, but it is only giving me the filename currently (I removed the img tags to see what was being output as I was being given a broken image as the complete URL isn't there!) Sure I'm close but would really be grateful for a pointer. Thanks so much Jon
  12. Thank you so much for all your help.
×
×
  • Create New...