Get dropdownbox text instead of the value in template Options
Tom
Posted: Friday, November 28, 2008 10:21:23 AM

Rank: Newbie

Joined: 6/28/2008
Posts: 14
Location: The Netherlands
Is it possible to get the text of a dropdownbox instead of the value in a template?
For example:
value = 12 text = "Option 1"
value = 13 text = "Option 2"
value = 15 text = "Option 3"

In a macro i can get the textvalue but not in a template
<?UMBRACO_GETITEM field="Option"/>

Is this possible? or do i really need a macro?
Thanks in advance.

Dirk
Posted: Friday, November 28, 2008 10:43:00 AM

Rank: Umbracoholic

Joined: 9/27/2007
Posts: 1,123
Location: Belgium
Are you on v4? If so, you could some inline xslt to get the text rather than the value.

umbraco.library.GetPreValueAsString(id)

I'm afraid you're not on v4, as you're using the <?UMBRACO_GETITEM/> syntax, right?

I've made some datatype a while ago that let's you specify what get's saved.

http://www.netaddicts.be/blog/2008/9/9/codepicker-v02.aspx

It does rely on external tables though, so it might be overkill if you've got only a few options. But it would work as you'd like it to.

It's been designed for v4 but comes with full source, so you could change that to work with v3. But again, that would be big overkill compared to creating a macro as you've suggested already.

Regards,
/Dirk


level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Tom
Posted: Friday, November 28, 2008 10:46:34 AM

Rank: Newbie

Joined: 6/28/2008
Posts: 14
Location: The Netherlands
Dirk wrote:
Are you on v4? If so, you could some inline xslt to get the text rather than the value.

umbraco.library.GetPreValueAsString(id)

I'm afraid you're not on v4, as you're using the <?UMBRACO_GETITEM/> syntax, right?

I've made some datatype a while ago that let's you specify what get's saved.

http://www.netaddicts.be/blog/2008/9/9/codepicker-v02.aspx

It does rely on external tables though, so it might be overkill if you've got only a few options. But it would work as you'd like it to.

It's been designed for v4 but comes with full source, so you could change that to work with v3. But again, that would be big overkill compared to creating a macro as you've suggested already.

Regards,
/Dirk


Hi Dirk, thanks for your reply. I'm using 3.06 so it will be the maco!
Thank you for your other suggestions.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.