Trying to summarize it one last time:
The actual page title:
<em>This Is a Title</em>
The page link in body copy (using the regular link without HTML will work just fine):
[yadawiki link="This Is a Title"]
The page link in the TOC page (the HTML bit needs to be included or the page won’t be recognized):
[yadawiki link="<em>This Is a Title</em>"]
All index pages will display the italicized page titles correctly.
The issue with tables:
Links to a page with an italicized title (<em>This Is a Title</em>) will not be recognized when placed inside tables. Neither this ([yadawiki link=”This Is a Title”]) nor this ([yadawiki link=”<em>This Is a Title</em>”]) will work.
This is NOT about DISPLAYING them italicized as in your last example. The problem is that they’re not being recognized as pages in tables in the first place.
Plugin Author
dmccan
(@dmccan)
Thank you for clarifying about the page title. I was thinking that was within the shortcode only. I didn’t realize you were actually giving pages a name with ems in the title. For what it is worth, that as a practice doesn’t seem good to me and I think people would advise using CSS to style the actual page title.
In any event, I created a page with ems in the title and the reason why when you include that page in a wiki shortcode (without the extra ems) is that the actual page title is with ems, if that makes sense. So that is why manually adding them into the wiki tag you get a working link on the frontend.
I created a page with ems in the title, and then a wiki shortcode to that page with the ems manually added in. That worked fine on the front, and in the toc, index page, and category list.
I created another page with ems in the title, and then a wiki shortcode to that page with the ems manually added in. I then switched to the text editor and pasted in the table code from above, but without the shortcode and instead just added a word in its place. I switched back to the visual editor and copied the shortcode with the link to the page with the ems as a title and with the ems added manually, switched back to the text editor and pasted that in. Saved. When viewing that on the frontend the table showed, the wiki link showed italicized, and the link worked. Perhaps you are generating your tables somehow that is playing a role.
Thanks for getting back.
I wouldn’t necessarily call it bad practice as it is also the only way to do it in WordPress, and publishers actually do use it that way. Just a random example:
'Sad' Keanu Reeves Memes Aren't Accurate, Says <em>John Wick</em> Director: He's an 'Incredibly Positive Guy' (Exclusive)
Looking up albums in Wikipedia you’ll notice that they’re italicized using <i>. Example:
<i>Songs in the Key of Life</i>
As for the CSS method: Of course I can style all page titles using CSS, but not all page titles are supposed to be italicized — only actual titles (see above example). So that’s not a solution either as that method would affect all titles.
Again, I can work around most as described in my earlier post, but in tables, page titles that include HTML are being ignored and won’t generate a wiki link which is a knock-out criterion.
So, if that can’t be fixed, I will have to roll back and live with the fact I won’t be able to display titles the correct way.
I hope this clarifies it.
Thank you again.
Hi David,
I hope all is good.
Did my last answer help clarify things for good?
I would appreciate a quick response so I can move on with things. Even more so if this could actually be fixed. That’s really the only issue I’m having. Everything else is working as expected.
Thanks much.
Plugin Author
dmccan
(@dmccan)
@jfbprivate – Could you share please how you are creating the tables? Thanks
Scratch everything up to here. I just realized it has nothing to do with body, table, or TOC. That was all just coincidence because the editor automatically converted some links after switching from text to visual. The behavior is the same for all of them.
To make links that have italicized titles work, they would have to look like this:
[yadawiki link="<em>This Is an Italicized Title</em>"]
The shortcode doesn’t seem to accept special characters, that’s all. Replacing them with their HTML entities will work:
< for the less-than sign: <
> for the greater-than sign: >
So the only question would be, is there a way to fix that in order to make editing a little easier, or is this just the way shortcodes work.
Plugin Author
dmccan
(@dmccan)
@jfbprivate – Good sleuthing to figure this out. Sorry it took so long. I think that is the way shortcodes work. In January I plan to work on an update and perhaps could add an optional parameter to italicize the display link. If something like that would help please let me know.
@dmccan Thank you for bearing with me. Yes, that’s what I thought too. Something like that would indeed help. Holler if you should have any questions regarding the implementation. I would probably refer to how Wikipedia handles the italicization of certain titles or parts of titles. For examples see above.
Thanks again!
Plugin Author
dmccan
(@dmccan)
@jfbprivate – Will do, and I’ll see if I can find how Wikipedia does it.
Plugin Author
dmccan
(@dmccan)
Hi @jfbprivate – This is the direction I’m going: When you click the Wikilink Popup there will be a checkbox for adding a class.
https://share.zight.com/NQuno2DP
When checked then it will add another parameter to the shortcode:
[yadawiki link="Quote Test" show="It is a quote" class="wikilink-custom-class"]
On the wiki link for the page a class of “wikilink-custom-class” will be added. If you want to, you can type over the default “wikilink-custom-class” to add a different class name (lowercase and dashes only) and it will add that to the link instead.
You can then add to the Customizer or a stylesheet the CSS for “.wikilink-custom-class“.
Does that sound good?