Home Forums Xi Theme Discussion & Support Open select slider links in new window

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  themeweaver 4 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3001

    bryan stinchfield
    Member
    Post count: 1

    Is there a way to open selected slider links from the features section (when chosen or when the redirect URL is set) in a new window? Alternatively, I think it could work as well if any link that has a redirect url is opened in a new window.

    i’m looking through the code to see how to add this but not finding a straightforward answer. Please help, thank you!

    The other thing that could work is if I can get the theme to stop striping any HTML code from a link entered into the redirect URL field in features. Thank you

    #3003

    themeweaver
    Keymaster
    Post count: 730

    You would need to add a target attribute to the anchor tag generated in base\lib\flexi-slider.php.

    target=”_blank”

    But I advise against modifying code here, as any theme updates will overwrite it. Though there is no other way of doing it.

    #3004

    bryan stinchfield
    Member
    Post count: 1

    They only overwrite it if you update the theme :)

    The better option would be to build in a new option coming from the features page itself OR, this would be absolutely ideal, to have the ability to tell the code to stop removing html, quotes, spaces, etc from a link when it is saved. If ou type in the redirect linik and add ” target=”_blank which would in essence add the correct code and the proper number of quotes to the target attribute, the system then removes all spaces and ” symbols. It should NOT remove the spaces as some links would have a space ( http://www.something.com/folder name/ )

    one thought I just had is to see if I can add the code name for the things I want in it … I doubt it’ll work but worth a shot. Does anyone know the code for a ” _ and = ? I know a space is %22 or %20

    Hmm … would love to find a solution to this. Even if it involves adding a database entry, modifying the code to have a new variable, and then having it insert or not.

    If you look at the links section this option is there already, you can choose your target. Developer, can you copy the target option from the links section to the features section for the redirect URL?

    #3006

    themeweaver
    Keymaster
    Post count: 730

    It would be very bad not to sanitize text fields. Goes against all guidelines for theme and plugin development.

    Adding target into the field even without sanitization – not sure why you think that would work. The text entered in the box is inserted in the href attribute. I.e. href=”your entered text” So adding target=”” in this text would totally break it, could even break your whole page. And links shouldn’t have spaces by the way.

    It would be fairly simple to add this as an extra option to features. We’ll add it to the list. If other users would like this they should give the thumbs up here too (it will move further up the list that way!).

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

You must be logged in to reply to this topic.