Forum Replies Created

Viewing 15 replies - 1 through 15 (of 38 total)
  • Thread Starter yann1ck

    (@ja4st3r)

    Hi Sybre,

    thank you very much for your response and your example. Why are you not using the “the_seo_framework_breadcrumb_shortcode_output” filter? Thats what I played with before going with a CSS only solution. Perhaps it is helpful for someone else.

    .tsf-breadcrumb .breadcrumb-item:not(:nth-child(-n + 2)):last-of-type {
        display:none;
    }
    
    .tsf-breadcrumb .breadcrumb-item:not(:nth-child(-n + 1)):nth-last-of-type(2)::after {
        display:none;
    }
    Thread Starter yann1ck

    (@ja4st3r)

    Hi Lap,

    is that bug on the roadmap for a future version? I tried to fix it myself yesterday, playing around with the conditionality.js, but it is beyond my abilities 😀

    Kind Regards

    Yannick

    Thread Starter yann1ck

    (@ja4st3r)

    I just add a pull request for my suggestions.

    While doing that I saw that you accounted for the prefixes. I have missed that before

    • This reply was modified 3 years, 6 months ago by yann1ck.
    Thread Starter yann1ck

    (@ja4st3r)

    Hi Phi,

    sorry that I did not give you more details. I dont like the prefixes and personally dont use them.

    By default WordPress adds prefixes to archive pages, e. g. “Archive” for custom post types or ‘Author’ for author archives or ‘Month’ for archives sorted by month. I think a user expects that these prefixes are “part” of the archive title and should be part of the breadcrumb trail as well.

    Example:
    I have a custom post type ‘book’ and list various kinds of books. I have a archive where I list all books, and the default title is ‘Archive: books’ (because it uses the prefix). One book is ‘The Hobbit’, so the breadcrumb trail would be ‘Home / book / The Hobbit’, but I think a user would expect ‘Home / Archive: book / The Hobbit’.

    I have not thought about taxonomy archives or any other kind of archive. I am not sure how to deal with prefixes for these. Furthermore I am not sure if there is a easy and performant way to access the prefix outsite of the loop.

    Regards
    Yannick

    Thread Starter yann1ck

    (@ja4st3r)

    Hi Phi,

    thank you for your fast response!

    I have on more suggestion. To get the name of an archive you use $post_type->labels->singular_name, but the singular name is not the same as the archive title. If I have an archive listing books there is an important difference in meaning between ‘books’ and ‘book’. So perhaps name would be better? (There is also the problem with prefixes, but I think there is no easy solution for it.

    Is there a Github repo? I can write a pull request for both suggestions.

    Kind regards
    Yannick

    Thread Starter yann1ck

    (@ja4st3r)

    Hi Phi,

    thank you very much for the update! I already tested it and it works great. I have one minor suggestion: The editor preview doesnt change, so it still shows “Dummy title”.

    I was just looking at the JSON-LD Breadcrumb Schema of you plugin and I think I found a bug. I am using https://validator.schema.org/ to check the schema and get no warning, but the ‘@type’ looks off. I should be something like ListItem or BreadcrumbList, but in my testing it is https://example.org/BreadcrumbList.

    I think the culprit is a missing @context in generate_breadcrumb_structured_data. If you add something like $markup['@context'] = 'http://schema.org'; somewehere around line 465 it should work.

    Regards
    Yannick

    Thread Starter yann1ck

    (@ja4st3r)

    Hi, thank you for considering my suggestion!

    Thread Starter yann1ck

    (@ja4st3r)

    Hi Ying,

    Thank you very much for the super fast response. It worked great.

    Kind regards
    Yannick

    Thread Starter yann1ck

    (@ja4st3r)

    Hi Robert, thank you for the reminder. I totally forgot to change the status.

    Thread Starter yann1ck

    (@ja4st3r)

    Hi Robert, that worked like a charm. Thank you very much for your help 🙂

    Thread Starter yann1ck

    (@ja4st3r)

    Hi, thank you very much for looking into the error and creating a bug report! 🙂

    Thread Starter yann1ck

    (@ja4st3r)

    Hi Lap,

    your example shows the working example with data-show-if, not the not-working one with data-hide-if. Form 1 in my example.

    In that example the HIDDEN_TEXT input is set as required, but I am able to submit the form even if the input field is empty. The validation is not working because HTML Forms removes the required attribute and replaces it with data-was-required:true. I would expect the required attribute to be added back if a input field is not hidden.

    Thread Starter yann1ck

    (@ja4st3r)

    Hi Lap,

    thank ou very much for your response and I am super sorry that I didnt answer las week, but it was a busy week.

    I am not using anything to combine and minify JS.

    You can test on this site: https://masterliste.psyfako.org/test-formular/

    The forms are exactly the two forms from above. Its a Divi site but I have the same problem on a staging site that using a clean install.

    Do you need more information?

    Thread Starter yann1ck

    (@ja4st3r)

    Hi @lapzor did you perhaps miss my addtional question, because the topic is already marked as resolved?

    Thread Starter yann1ck

    (@ja4st3r)

    Hi,

    I already change the duplicate names and also added some server side validation.

    Playing around with the data-hide-if attribute I think I encountered a bug when using a required input.

    In that case HTMLForms removes the required attribute from the input element and replaces it with a data-was-required:true attribute. Thats a nice solution to add detect if a ‘required’ tag needs to be added back, but it is not added back. That leads to problems with front-end form validation, because fields that were set as required are not required anymore.

    I build a simple example with data-hide-if, to show the problem.

    
    <p>
      <label for="SELECT_1">Select a option</label>
      <select name="SELECT_1" required id="SELECT_1">
        <option value="" disabled selected hidden>Select</option>
        <option value="One">One (hides the text field)</option>
        <option value="Two">Two</option>
      </select>
    </p>
    <p data-hide-if="SELECT_1:One">
    	<label for="HIDDEN_TEXT">Text field (is hidden if you select one)</label>
    	<input type="text" name="HIDDEN_TEXT" required id="HIDDEN_TEXT" />
    </p>
    <p>
    	<input type="submit" value="Absenden" />
    </p>
    

    In this example the text field is set as required, but this attribute is remove by HTMLForms on page load an replaced with data-was-required:true. I would expect the text field to required, so that the form valdiation works and it is not possible to submit the form with an empty text field.

    If I use data-show-if it works as expected. But it is not always possible to use data-show-if instead of data-hide-if:

    
    <p>
      <label for="SELECT_1">Select a option</label>
      <select name="SELECT_1" required id="SELECT_1">
        <option value="" disabled selected hidden>Select</option>
        <option value="One">One (shows the text field)</option>
        <option value="Two">Two</option>
      </select>
    </p>
    <p data-show-if="SELECT_1:One">
    	<label for="HIDDEN_TEXT">Text field (is visible if you select one)</label>
    	<input type="text" name="HIDDEN_TEXT" required id="HIDDEN_TEXT" />
    </p>
    <p>
    	<input type="submit" value="Absenden" />
    </p>
    
    • This reply was modified 3 years, 8 months ago by yann1ck.
Viewing 15 replies - 1 through 15 (of 38 total)