WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Glossary] Dynamic Linking Failure (15 posts)

  1. lawvol
    Member
    Posted 5 years ago #

    I have been testing this out, and love the concept. My problem is that I cannot seem to get the dynamic links to work from within the posts on my blog. When I type in the "term" as part of a sentence, I don't get any links back to the definition.

    It does, however, work on pages on the site. I have the options set to:
    Only show glossary on single pages = 0(No)
    Show on Pages = 1(Yes)

    Is there some sort of code that I need to be inputting for this to happen? Any other thoughts (or known conflicts)?

    Thanks.

    http://wordpress.org/extend/plugins/automatic-glossary/

  2. rduffy
    Member
    Posted 5 years ago #

    I'm sorry you're having some problems.

    What version of PHP are you using? Is there a site I can see your problem on?

    I just tested it with the same settings you have:

    Only show glossary on single pages = 0(No)
    Show on Pages = 1(Yes)

    On my site http://www.alaskaedu.net and it worked as expected.

    If you change the settings to:

    Only show glossary on single pages = 1(Yes)
    Show on Pages = 1(Yes)

    do you have the same issue?

  3. rduffy
    Member
    Posted 5 years ago #

    I just had an additional thought.

    Are you getting any php errors or warnings on the blog posts that the glossary isn't working on? I ask, because I've discovered that if you don't have perfectly valid html in your post content (including properly "closing" any <br /> and <img /> tags) then the glossary won't work. The script puts out a warning and skips the glossary stuff. The script is especially picky if you are using php 5, because it's using the XML Dom functions that only work with valid XML markup.

    Because it's just a php warning, if you have error reporting set to not display to the public (like a good boy...) then you wouldn't even know the error was thrown.

    That might be what's going on in your case. Do you have a sample page I can go look at to see if that might be what's going on.

  4. mdowling
    Member
    Posted 5 years ago #

    Hi Robinson,

    Just thought I would share a fairly ugly workaround to this problem. Simply add the line:

    error_reporting(0);

    below the opening php tag. It's ugly because it doesn't fix the underlying problem but simply covers it up.

    The problem arises because the visual editor in WP puts spaces between tags. Eg,

    <p>text here</p> <p>more text here</p>
    +--- space character in here.

    Hand edit to remove these in the html pane & the problem goes away. But make an edit in the visual editor, problem comes back. It is also a problem with posts uploaded from Microsoft Live Writer, which is a pain in the (_!_) because it's so easy for non-techos to use.

    It would be great if there was a way to 'desensitise' the loadXML function but I'm not smart enough to figure that one out.

    BTW I tried it also in a PHP4 environment & the problem is still there in the loadHTML function.

    However - it still puts glossary links in all the right places, which is the Desired Outcome.

  5. mdowling
    Member
    Posted 5 years ago #

    Robinson,

    One other thing I talked to you about some weeks ago. Would be great to sort glossary entries alphabetically. At the moment it sorts them according to page number (ie, order in the database) in reverse order (most recent first). It's easy enough to reverse this but I haven't figured out how to make it sort according to the glossary entry itself. Again, I'm not enough of a code expert to figure it out.

    cheers
    Mark

  6. kevbryant
    Member
    Posted 5 years ago #

    hey im having a similar issue. ive turned off error reporting, and that works mostly. but it works on some pages and not on others. i have tables on the page that doesn't seem to get links. could that be the problem?

  7. kevbryant
    Member
    Posted 5 years ago #

    also doesnt seem to put links into widget text

  8. rduffy
    Member
    Posted 5 years ago #

    KevBryant,

    No, it does not put any links in widget text. The program was not designed to put the links into widget text. It only works on the post or page body.

    As stated above, if your html code is not xHTML compliant, the plugin won't work. Your tables might not be xHTML compliant. Do you have an example page I can look at?

  9. chartinael
    Member
    Posted 5 years ago #

    I added the following

    Line 179ff

    //create the actual glossary
    
    function red_glossary_createList($content){
    	$glossaryPageID = get_option('red_glossaryID');
    	if (is_page($glossaryPageID)){
    		$glossary_index = get_children(array(
    		   'post_parent'	=> $glossaryPageID,
    		   'post_type'	=> 'page',
    		   'post_status'	=> 'publish',
    		   'orderby'        => 'menu_order title', // added for automatic sorting
    		   'order' => 'asc'                 // alphabetically of children var. desc
    		  ));

    It works.

    Noticed a bug ... if you link to anything and the link text contains glossary term, glossary tries to link term anyhow.

    I presume you'd need some sort of exclusion when parsing hrefs.

  10. rduffy
    Member
    Posted 5 years ago #

    chartinael,

    Noticed a bug ... if you link to anything and the link text contains glossary term, glossary tries to link term anyhow.

    I presume you'd need some sort of exclusion when parsing hrefs.

    Do you have an example of this bug in action?

    Do you mean that if you have a glossary term "apples" and you have the following code on your page:
    <a href="www.example.com/apples.html">
    That it is trying to link that instance of "apples"?

    Hmmm...interesting problem...

  11. chartinael
    Member
    Posted 5 years ago #

    Hold on, let me check the instances out ...

  12. chartinael
    Member
    Posted 5 years ago #

    Ok,

    My glossary term: Apples - page created, child of glossary.

    I have a post somewhere on my site.

    Variation I:
    there is the link

    <a href="www.example.com/apples.html">Klick here for more info</a>

    This will cause dom errors and will keep glossary term apples to be linked anywhere on this post/page.

    Variation II:
    <a href="www.example.com/info.html">Klick here for more info on Apples</a>

    This will cause a bunch of dom errors as well, but the linking of the term will happen to get link on the rest of the page (so when error reporting is off, this is fine)

    Variation I is really the problem because besides spitting out errors it will not link the term.

    kristin

  13. chartinael
    Member
    Posted 5 years ago #

    maybe it would help, if parser only looks for EXACT glossary title ... with spaces before and after ... that way it won't run into issues when term is part of a composite noun or an href.

    kristin

  14. trau
    Member
    Posted 5 years ago #

    hi robinson! congratulation for your glossay automatic , it is very great! but i have a problem i need if uoi can hel me:
    i need that the href the link to page of index glossary page is "post title" and not href='?page_id=3122'.
    (for example) i need of href='post title of glossary menu'
    i am not very good programmer in php , you can help me please?
    sorry my bad english
    i attend yuor cortesy anwser please :)
    bye erwin

  15. ladykathleen
    Member
    Posted 4 years ago #

    I know everyone has been talking about this months ago, but I only started using the plug in. I have used a couple of the ideas here that have helps with most things.

    The problem I have now is:

    Terms like Bar and Barbed.

    When I use a term that is part of another term the first one errors and never shows the link to the term.
    I think deals with the same type of problem that chartinael was having and the terms need to be the EXACT term with a space after it.

    I have looked into the code and can't figure out where I need to add this to the code. Is there anyone that can help with this?

Topic Closed

This topic has been closed to new replies.

About this Topic