21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 607 Views |
-
Template Control Question

22 August 2011 at 12:38pm
Hello,
I am attempting to use the SimplePicasaGallery module and pull content to another page. I'm a bit of a silverstripe noob so be warned.
I have the following in a theme template. I created a SimplePicasaGallery page named "pics". I'm attempted to pull one of the functions and display photo thumbs. I can't get any of the functions in the page_controller to call from the control tag for the template. In this case I'm tyring to call PIcasaAlbumList which should have a $Thumb url that would be displayed. However the following code does not display anything.
Note: If I go to the pics page everything displays so I know it is working.
Here's my code:
<% control Page(pics) %>
<% control PicasaAlbumList %>
<a href='$Top.Link/viewalbum/$Id'>
<img src="$Thumb" alt="$Description" <% if ShowDescription %>title="$Description"<% end_if %>/>
</a>
<% end_control %>
<% end_control %> -
Re: Template Control Question

22 August 2011 at 8:56pm
Are you sure that 'pics' is the URL segment of the picasa page? Double check 'meta data' tab. My hunch is it might be something else?
-
Re: Template Control Question

23 August 2011 at 12:37am
Its pics. I purposely named it to make it easy.
So what am I missing to make this work?
-
Re: Template Control Question

23 August 2011 at 12:49am Last edited: 23 August 2011 12:49am
Try putting something like this in the controller for the page you want to bring the picassa page into:
function ShowPicsPage(){
$get = DataObject::get_one('TheClassNameOfYourPicassaPicsPage', "URLSegment = 'pics'");
return new TheNameOfThePicasa_Controller($get);
}Then in your template:
<% control ShowPicsPage %>
<% control PicasaAlbumList %>
<a href='$Top.Link/viewalbum/$Id'>
<img src="$Thumb" alt="$Description" <% if ShowDescription %>title="$Description"<% end_if %>/>
</a>
<% end_control %>
<% end_control %> -
Re: Template Control Question

26 August 2011 at 12:55am
Sweet!!!
It works. Thanks Magic. I have learned something more about Silverstripe!!!
| 607 Views | ||
|
Page:
1
|
Go to Top |


