Pulling item name into variable/field?

joejubee
joejubee Community Member Posts: 325 ✶ Headliner ✶
Is there a way to pull the name of an item (for example, a button) into either a variable or into an actual text field? I'm not talking about the HTML Name of the object - I'm talking about the name of the item that is shown on the left in the Title Explorer.

 

Thanks!

Comments

  • timk
    timk Community Member Posts: 1,207 ♦ Idol ♦
    I think, the only place where this name can be get from after publication is the ALT tag. If you publish with "Create ALT tags for images and buttons" unchecked, I don't think there's a way to retrieve it dynamically. If you have ALT tags it's easy, but probably only available for images or buttons, i.e. objects with alternative text.
  • joejubee
    joejubee Community Member Posts: 325 ✶ Headliner ✶
    What about a way to pull the ALT tag into a variable?
  • timk
    timk Community Member Posts: 1,207 ♦ Idol ♦
    You can use Lectoras Token Replacement, by adding two actions to the object:

    On: Page show
    Action: Modify variable
    Target: myAltTag
    Type: Set as empty

    On: Page show
    Action: Run javascript
    Javascript:
    VarmyAltTag.set(%HTMLNAME%.altName);

    Mind you have to publish. Preview is always without alt tags.
  • joejubee
    joejubee Community Member Posts: 325 ✶ Headliner ✶
    Tim - that is awesome! Thank you so much!