Jump to content


cmscritic

Member Since 09 Mar 2012
Offline Last Active May 08 2013 10:44 AM
-----

Posts I've Made

In Topic: What CMS do you use and Why?

08 May 2013 - 10:45 AM

Yah, unfortunately comments can get rather messy but my hope is that it gives at least some of an idea for people.


In Topic: Calling an image field in a template

04 April 2013 - 11:29 AM

Good call guys, done.


In Topic: Calling an image field in a template

03 April 2013 - 05:24 PM

Looking at the screen it must be a multiple images field. In that case it's an array and you have to either change it to max 1 image int he field setting or chose the first from the array:

<?php 
$image = $page->logo_image->first->size(287,80);
echo "<img class='logo' src='{$image->url}' alt='{$image->description}' />";
?> 

 

Ah didn't read careful..

 

This is also possible I think:

 

<?php echo "<a href='{$config->urls->root}'><h1><img class='logo' src='{$page->logo_image->size(287,80)->url}' alt='{$image->description}' /></h1></a>";?>

 

That worked perfectly, (the second example that is) I wasn't sure the context to use. Thank you & thanks to all others who replied.


In Topic: Calling an image field in a template

03 April 2013 - 05:02 PM

Thanks RJay.

 

So far, I followed the tutorial I found here and came up with this code, which outputs the logo above and the "site_title" below. Now all I need to do is figure out how to wrap the logo with <a href='{$config->urls->root}'> and I'm good. Code is as follows:
 

<?php $image = $page->logo_image->size(287,80); echo "<img class='logo' src='{$image->url}' alt='{$image->description}'  />"; ?> 
<?php echo "<a href='{$config->urls->root}'><h1>{$homepage->headline}</h1></a>"; ?>

 

 

Thoughts?


In Topic: Calling an image field in a template

03 April 2013 - 04:42 PM

Update: I tried following the FAQ on the issue but couldn't get it to work.