• Hi,

    I’m having an issue with quotation marks in shortcode links.

    I require some titles to be in quotation marks, basically like this:

    [yadawiki link=”This Is a Title” show=””This Is a Title””]

    Now I know there can be issues when it comes to quotation marks within quotation marks and mixing them in shortcodes.

    So I tried this:

    [yadawiki link=’This Is a Title’ show='”This Is a Title”‘]

    And even this:

    [yadawiki link=”This Is a Title” show=”‘This Is a Title'”]

    However none of that is working, ‘show’ will be ignored entirely.

    Is this a bug, and what would be the best way to achieve this in Yada Wiki? I would like to avoid using HTML in order to keep it user friendly.

    Thanks much.

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author dmccan

    (@dmccan)

    I did some searching and see people asking similar questions regarding double quotes within shortcodes for years. I think they are filtered out for security purposes. I was able to use a single quote inside of double quotes, but I don’t know if that will always work. (it is possible in your example the single quote was curved?)

    [yadawiki link="This is a test" show="'This is a test'"]

    Thread Starter jfbprivate

    (@jfbprivate)

    Thanks for the quick response.

    This is a working solution using HTML:

    [yadawiki link="This Is a Title" show=""This Is a Title""]

    Now, similarly to using quotation marks for some titles, I’ll have to italicize others. The problem with that is that <em> seems to be ignored in both ‘link’ and ‘show.’

    Wrapping the entire shortcode in <em> would work:

    <em>[yadawiki link="This Is a Title" show=""]</em>

    However, I also need the page title to be italicized, which means that the Yada link would no longer be “This Is a Title” but “<em>This Is a Title</em>” since that’s what the actual page title would be now. That brings up another issue because Yada Wiki won’t accept <em> as part of a link and will turn it into a ‘wikilink-no-edit.’

    If the plugin would accept HTML in page titles, I could make it work like in the following:

    [yadawiki link="<em>This Is a Title</em>" show=""]

    As mentioned above, I have also tried using <em> in ‘show’ but that is being ignored too:

    [yadawiki link="This Is a Title" show="<em>This Is a Title</em>"]

    In order to make it work like in the above example, the plugin should IGNORE the HTML in the page title (‘link’) and ACCEPT the HTML in the ‘show’ part. That would probably be the most straightforward solution. I’m actually surprised that it does accept ‘&quot;’ but not <em>.

    I feel like especially a wiki should be capable of styling titles properly. Am I missing something?

    Thanks again for looking into this!

    Thread Starter jfbprivate

    (@jfbprivate)

    PS: I forgot to mention that I was referring to the TOC page and other lists.

    Setting up an index table via [yadawiki-index type=”pages” columns=”4″], on the other hand, all pages with titles in the form of ‘<em>This Is a Title</em>’ will both display italicized and work as links correctly.

    Plugin Author dmccan

    (@dmccan)

    I’ve been able to create a wiki link that is italicized and has quotes around it by selecting the shortcode in the editor, then clicking on the italics button which makes the shortcode italicized in the editor and the output italicized on the frontend, and then putting quotes around the shortcode which results in quotes around the output wiki link on the frontend. Note however, the links don’t appear italicized or with quotes in the index.

    Thread Starter jfbprivate

    (@jfbprivate)

    Thanks for your response and apologies for the late reply.

    I think I can live with that. I noticed that even Wikipedia has the quotes outside the title link.

    There is one last issue however. The page titles for titles that need to be italicized are in the following format which works well all throughout WordPress:

    <em>New Title</em>

    This will display them correctly on both the actual pages and index pages of Yada Wiki, TOC being the exception.

    The TOC page somehow doesn’t recognize them as existing pages. Could that be caused by the HTML in the titles? Interestingly that is not an issue anywhere else. The HTML bits are being ignored on all other pages.

    I’ve tried the following but the links show up as not-yet-existing pages:

    [yadawiki link="New Title" show=""]

    [yadawiki link="<em>New Title</em>" show=""]

    Any idea what might be causing this or why the TOC page is behaving differently from the rest of the wiki?

    Thanks again!

    Thread Starter jfbprivate

    (@jfbprivate)

    Hi,

    Any news on this?

    Thank you.

    Plugin Author dmccan

    (@dmccan)

    Wiki links have a CSS class. Can you target that to apply the style?

    Thread Starter jfbprivate

    (@jfbprivate)

    Yes and no, because the links aren’t being generated. Instead I get a span with .wikilink-no-edit.

    It should be a link with .wikilink-published though.

    The problem is that, unlike in other areas of the wiki, the TOC page will not accept/ignore the <em> in the page title. So my workaround is to actually include the <em> in the titles of the TOC page.

    So instead of [yadawiki link=”This Is a Title”] like for the rest of the wiki, I would have to use [yadawiki link=”<em>This Is a Title</em>”] to make them work. Which is a little confusing and makes it more complicated than necessary because now I will have to remember which titles are italicized.

    Is there a way to make title links in the TOC work like everywhere else, not needing to include the <em> in the title?

    Thanks again.

    Thread Starter jfbprivate

    (@jfbprivate)

    Unlike the index page items which are wrapped in <div>, maybe this behavior is caused by list items since the TOC links are wrapped in <ul> and <li>. Just an idea.

    I also noticed that in tables, italicized page titles won’t work or be recognized as links at all — not even with the help of the workaround that does the trick for the TOC.

    None of the following will be recognized as links:

    <td><em>[yadawiki link="This Is a Title"]</em></td>
    <td><em>[yadawiki link="<em>This Is a Title</em>"]</em></td>
    <td>[yadawiki link="This Is a Title"]</td>
    <td>[yadawiki link="<em>This Is a Title</em>"]</td>

    Unless you can figure out these two issues, I will probably have to go back to normal page titles and live with that for now.

    Plugin Author dmccan

    (@dmccan)

    Are there cases where you don’t want the link to be italicized? If so, what are they please?

    Thread Starter jfbprivate

    (@jfbprivate)

    When the actual page title is italicized using <em> I also want the title to be italicized everywhere, otherwise I wouldn’t format it that way.

    So far I have figured that I need to add the <em> OUTSIDE of the shortcode to italicize titles in the body copy.

    I also found out that index pages will automatically recognize and honor the italicization and display the links accordingly (working links with italicized titles), unlike the TOC page which acts differently. There, I would have to include the <em> INSIDE the shortcode in order for the TOC page to recognize those titles in the first place.

    Lastly, in tables, none of the workarounds will do, as wiki pages that have an <em> in their title won’t be recognized at all.

    Does that clear things up?

    Plugin Author dmccan

    (@dmccan)

    You didn’t quite answer my question, but here is CSS to italicize all wiki links. I hope it helps.

    .wikilink-published {
    font-style:italic;
    }

    .ywcolumn > .wikicatlink {
    font-style:italic;
    }

    .wiki-cat-list > .wiki-cat-item > .wiki-cat-link {
    font-style:italic;
    }

    Thread Starter jfbprivate

    (@jfbprivate)

    Thanks but that isn’t what I’m talking about at all. I don’t think we’re on the same page here.

    I know my way around CSS and how to italicize text. This is about page titles that are italicized using <em> and therefore no longer being recognized as proper Yada Wiki links.

    The page title actually is “<em>This Is a Title</em>” appearing like This Is a Title on a page and on index pages.

    The problem is that in tables (<table>) they are NOT being recognized as valid links any longer (see my post above).

    The other problem is that on the TOC page, the <em> part has to be INSIDE the shortcode to make it work and generate links successfully, like this:

    [yadawiki link="<em>This Is a Title</em>"]

    Everywhere else in the wiki the following will do (without the <em>):

    [yadawiki link="This Is a Title"]

    I think if you read my posts again you’d understand. But I will try again and summarize what we have so far:

    (1) I need SOME (page) titles to be italicized, which requires HTML, like in the following (please note that I’m referring to actual WordPress page titles here):

      <em>This Is a Title</em>

      (2) In order to have those titles appear italicized in body copy as well, I can do the following:

      <em>[yadawiki link="This Is a Title"]</em>

      (3) So far, all is working fine, including on the index pages (All Pages, Categories). The links will work, and even the respective titles will automatically be italicized on those pages. For body copy I use the HTML workaround as described in (2).

      (4) Now the problem is, that in tables neither the regular Yada Wiki link ([yadawiki link=”This Is a Title”]) nor the workaround needed for the TOC page ([yadawiki link=”<em>This Is a Title</em>”]) will work.

      Bottom line: I could live with the workaround for the TOC, adding <em> inside the shortcode (even if inconvenient), but if italicized WordPress page titles won’t be recognized in tables at all, then that’d be a knock-out criterion and I would have to relinquish that concept. I admit it’d be a pity, especially for a wiki since that’s how title are being formatted in this context.

      That’s why I was asking whether or not you know why wiki links in TOC and tables behave differently than in the rest of the wiki and if this is something that can be fixed.

      Thank you.

      Plugin Author dmccan

      (@dmccan)

      @jfbprivate – I’m sorry you are feeling some frustration.

      For what it is worth, I was able to output a regular wiki link in a table and have it italicized and working. Here is the code:

      <table>
      <tbody>
      <tr>
      <td><em>[yadawiki link="Beaver Builder" show=""]</em></td>
      </tr>
      </tbody>
      </table>

      For me, to get it to work it needed to be edited in the Text tab of the classic editor, not the visual tab.

      Although it worked, I imagine the various steps you have to take aren’t a very nice workflow.

      The reason I asked my question earlier is if there are some rules then maybe we could find a way to add a CSS class that you could target. Since the CSS I provided earlier works in all three cases, if you could add a class to the wiki links you want italicized then it seems like that might solve your problem. I expect you could also add quotes using CSS. Although I am busy now, at some point in the next version I could find a way for you to add a custom class to wiki links when you wanted to, i.e. perhaps another optional parameter. However, I guess you need more fine grained control.

      The TOC is its own page and the way that works is that the code to output the TOC shortcode content does a query to get the ID for a page with that name, uses a WP function to get the page content and output that content.

      apply_filters( 'the_content', $the_toc->post_content )
      Thread Starter jfbprivate

      (@jfbprivate)

      Not needed, I’m not feeling any frustration, I was only trying to make things as clear as possible.

      First of all, thank you again for your time and efforts.? Now let me try to narrow it down—it’s actually not as complicated as it might sound.

      <td><em>[yadawiki link="Beaver Builder" show=""]</em></td>

      Your example above is working for me too. But that’s not the point. I have a page title that is italicized. Those links are not working anymore when put in a table. I have attached a screenshot to illustrate what I’m talking about. I probably should have done that earlier.

    Viewing 15 replies - 1 through 15 (of 18 total)
    • You must be logged in to reply to this topic.