Explore the community Forums Lectora Lectora Questions & Answers Pulling item name into variable/field?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #330885 Score: 0
    Profile photo of Atlanta Joe
    Atlanta Joe
    Member
    beginner
    intermediate
    curious george
    contributor
    wise owl
    profile
    13 pts
    @joejubee

    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!

    #330906 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    354 pts
    @timk

    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.

    #330909 Score: 0
    Profile photo of Atlanta Joe
    Atlanta Joe
    Member
    beginner
    intermediate
    curious george
    contributor
    wise owl
    profile
    13 pts
    @joejubee

    What about a way to pull the ALT tag into a variable?

    #330911 Score: 1
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    354 pts
    @timk

    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.

    This post has received 1 vote up.
    #330991 Score: 0
    Profile photo of Atlanta Joe
    Atlanta Joe
    Member
    beginner
    intermediate
    curious george
    contributor
    wise owl
    profile
    13 pts
    @joejubee

    Tim – that is awesome! Thank you so much!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.