Page 1 of 1
[SOLVED] UDT, news and extra field for album
Posted: Fri Oct 02, 2009 10:11 am
by ankel
UDT, news andy extra field for album
Hello,
I want to make something like that:
I want to add filed like "album_number" where I want to place album number to this news.
Hello,
In my news template I insert:
Code: Select all
{if isset($entry->album_number)}
{show_me_the_album number="$entry->album_number"}
{/if}
And it's not working

Re: UDT, news and extra field for album
Posted: Fri Oct 02, 2009 3:07 pm
by Russ
Not sure what you are after here, but to display a specific photo Album you would use
{cms_module module="album" albums="1"}
Where '1' is the album id created by the album module.
If you want to use a smarty variable you have to capture it and use that instead of the '1'
Hope this helps
Re: UDT, news and extra field for album
Posted: Fri Oct 02, 2009 3:17 pm
by ankel
No, no
1. I added one extra field in News module named "album"
2. I want to put in this field the album number what I want to show
3. I want to generate at the end of news code {cms_module module="album" albums="[number of album I putted in my extra field in News module]"}
uff...
Hope you understand me now

Re: UDT, news and extra field for album
Posted: Fri Oct 02, 2009 3:29 pm
by Russ
Well as long as the variable you have is a number and the Album exists you should be fine? As I said, I think you would still need to capture your News (album id) variable in Smarty for use in the Album tag?
Re: UDT, news and extra field for album
Posted: Fri Oct 02, 2009 4:04 pm
by ankel
Exactly,
I need capture album id from extra field in news module, compile smarty tag with parameter (with UDT) and show this all at the end of the article.
Re: UDT, news and extra field for album
Posted: Fri Oct 02, 2009 5:33 pm
by Peciura
If you have created new field definition "album_number" of type "Text Input" insert
Code: Select all
{if !empty($entry->album_number)}
{cms_module module="album" albums=$entry->album_number}
{/if}
to news detail template
Re: UDT, news and extra field for album
Posted: Fri Oct 02, 2009 7:36 pm
by ankel
hmm...
I swear, that I tested it, and it didn't work. Now I is feeling silly. Thanks very much !
Greetings from Poland!
