Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1113396

    We’ve noticed that when you use the Icon List module (or similar modules) and enter a URL for the module to use as the link, it will create HTML like this:
    <a href='YOUR_URL'>Your Title< /a>

    But, if you enter HTML directly into a Text Block module, it will generate HTML like this:
    <a href="YOUR_URL">Your Title< /a>

    If you look closely above, one uses single quotes and the other uses double quotes. This becomes an issue with how some plugins (e.g. CryptX)works, since it is looking for one or the other, but not both single and double quotes.

    You don’t need a URL from me to see this behavior, just try an icon list element and add a URL with double quotes and then add a text block and add a URL and use double quotes and then look at the output.

    #1113526

    Hey lzevon,

    The single quotes are used within modules, if you use double quotes it would likely break the element in question.

    Best regards,
    Rikard

    #1113665

    Maybe I don’t understand the difference between a Text Block element and an Icon List element. They both seem to be modules, so not sure why it can’t be consistent or single quotes escaped in the code to keep it all consistent? Doesn’t matter single or double, it would be nice if it was consistent. If I enter Link (single quotes in an attempt to behave like the other elements) in the Text Block and save it, it saves as Link (double quotes). Very frustrating and your answer doesn’t really explain the issue.

    #1114196

    Hi,

    This issue is caused that in php you can write strings within single quotes or double quotes. Using double quotes has the advantage that you can insert variables in the string which makes the code easier to read – means you have to use single quotes to enclose the value. This is also for e.g. class declaration.

    Uusing single quotes is faster as the interpreter does not have to search the string for variables – therefore when you need to insert the result of a function call in the string many developers use single quotes – and then have to use double quotes to enclose the value.

    Best regards,
    Günter

    #1114269

    HI Günter, I agree! So why when I enter in single quotes in the Text Block element does Avia force it to double quotes? Why is it seemingly just that one element that forces double quotes? Thank you for your reply.

    #1115926

    Hi,

    Some patience until Gunter can come back on this please :)

    Best regards,
    Basilis

    #1116022

    Hi,

    This is WP default behaviour.

    You can check with a standard theme.

    Best regards,
    Günter

    #1116715

    OK thanks Günter. I thought the elements were part of the theme/avia framework and that would therefore control the behavior with regards to the quotes. If there’s nothing Kriesi can do (WP defaults) and the text element just operates differently than all other elements I guess we’re stuck with it.

    #1116724

    Hi,

    I’m afraid – yes. Changing this behaviour is nearly impossible without rewriting WP core js files.

    If you really need to limit href to either single or double quotes you can only do it by hooking in the_content filter with a very low priority (99999999) and replace it with preg_replace.

    Best regards,
    Günter

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Enfold HTML output inconsitencies’ is closed to new replies.