conseilgouz / AutoReadMore-J4

Auto Read More for Joomla 4.x/5.x
GNU General Public License v3.0
10 stars 5 forks source link

Paragraph or line break left when ignoring existing "read Mores" #12

Closed cybersalt closed 3 months ago

cybersalt commented 3 months ago

I just found this extension and think it's great. I just featured it on my YouTube channel.

In doing so I discovered that when you set the plugin to ignore existing "read mores" in the article,, it does, but it still leaves a paragraph or line break where the "read more" is/was in the article.

You can see this at this point in the video - https://youtu.be/XYBclSb6m6o?si=DaOJcpdGrlYcyqjs&t=265

BTW, this is on a J5 site.

conseilgouz commented 3 months ago

Thank you Tim for your video. I'll check this issue as soon as possible. Best regards, Pascal

conseilgouz commented 3 months ago

Hi Tim,

It's what we call a WAD (Work As Designed).

In your article 4, you have 2 paragraphs and a readmore between them.

When the plugin is set to ignore Joomla ReadMore, it deletes it. It does not merge existing paragraphs, so you still have 2 paragraphes : one with "Lots of text" and one with "Lots of text Lots of text ....".

Kind regards,

Pascal

cybersalt commented 3 months ago

Of course, that makes sense.

That leaves a problem because when a "read more" is inserted the editor puts a closing paragraph tag before the readmore and a new paragraph tag right after. So when the readmore is automatically removed, the unintended paragraph tags remain.

Would it be possible to have an option to select where those extra paragraph tags are removed if "ignore existing readmore" is set to yes"?

conseilgouz commented 3 months ago

Adding a choice seems to be a correct option. I'm working on it and let you know as soons as it is available. Pascal

conseilgouz commented 3 months ago

Hi Tim,

After some tries, I'm afraid it won't work.

I did the Autoreadmore part and it looks correct.

But, when you call the full article via read more button, Joomla displays your article with its new paragraph.

You may see the result in my temporary version where new option "merge paragraph" has been added : https://github.com/conseilgouz/AutoReadMore-J4/archive/refs/tags/5.2.7-rd2.zip

So I'm afraid I can't release this feature which breaks Joomla core behaviour.

Pascal

conseilgouz commented 3 months ago

https://github.com/conseilgouz/AutoReadMore-J4/assets/19435246/313a737e-feae-4516-a498-79399f0eeeea

cybersalt commented 3 months ago

Thank you so much for trying.

If I may trouble you with a related question - since I like auto readmore so much I thought a work around for this issue would be to move all the contents of the "introtext" field to the beginning of the "fulltext" field in each row of the X__content table - emptying the "introtext" field after.

I did this using an sql command in phpmyadmin and it worked great - except in each article there remains the readmore?

How is this possible and do you know how I can remove these from wherever they are being generated?

conseilgouz commented 3 months ago

Hi Tim, I just released 5.2.7 version that includes "paragraphs merge" in blog view and single article view. I don't like it too much, but it's a user choice, so I think it's not that risky. There's a note in inline help that tries to explain how it works.

autoreadmore

Let me know if it's what you expected.

Pascal

sarrene commented 3 months ago

I want to start off by saying Thank You! I really appreciate this plugin and the time you put into it! I will look for this at the Joomla Extensions page to make sure i rate it.

I did notice a few things, that may be unique to me. I also have one question: Is there a way to remove the title in the read more button? or is this unique to YooThemes? I may have to look into this.

Regarding YooThemes, I noticed a few things. If pages are made using the YooThemes page builders, there is a JS conflict and strips most of the templating out of that page and extends to full width.

At this moment, i just added the exclusion for those page categories.

Once more, Thank you so much!

conseilgouz commented 3 months ago

Thank you for your message.

Hide article title in readmore button is in Joomla articles global configuration : Menu System, global configuration, Articles menu, in Articles tab, look for "Read More with title" parameter and set it to No.

I'll add a note in plugin's inline help about this.

About page builders, there are already some fixes in plugin's code where it removes some remaining tags.

For example, in case of pagebuilderck, I just added a check on images where URIROOT code was left. There are also some lines that removes cck tags (between ::, like ::fulltext::, ::introtext::, ...). If you have an example of JS conflict, let me know and I'll take a look at it.

Pascal

cybersalt commented 3 months ago

Thank you for your message.

Hide article title in readmore button is in Joomla articles global configuration : Menu System, global configuration, Articles menu, in Articles tab, look for "Read More with title" parameter and set it to No.

I'll add a note in plugin's inline help about this.

About page builders, there are already some fixes in plugin's code where it removes some remaining tags.

For example, in case of pagebuilderck, I just added a check on images where URIROOT code was left. There are also some lines that removes cck tags (between ::, like ::fulltext::, ::introtext::, ...). If you have an example of JS conflict, let me know and I'll take a look at it.

Pascal

Hi Pascal,

Thanks for this reply, but I think it goes to what sarrene was asking. That said, I am glad it works with PageBuilder CK - my favorite pagebuilder!

sarrene commented 3 months ago

Good evening! Thank you so much for the reply. We are currently using YooTheme which is amazing in several ways, though is lacking in some areas as well. You know what they say, Never a one size fits all. I will have to go back and pull those conflicts and override notes out later. However, I can share a few snippets privately if you like, or give you access (privately) so you can see it in action.

Let me know if that can help. I also have a few other components installed at the moment as I am building and doing some tests to find a cck that works and handles the functionality that we had with K2.

I do not think I have used or looked into pagebrick yet. I was trying to update K2 to fit, but having some difficulties there as well. the biggest difficulty I have is not enough time due to the number of hats I wear currently.

Anyways, let me know in a PM if you would like access to our backend site to see how it is working and do some digging. It may help for a few additional 3rd party components and plugins and help improve this wonderful plugin and serve others out there :)

Be well and have a great night!

cybersalt commented 3 months ago

Hi Tim, I just released 5.2.7 version that includes "paragraphs merge" in blog view and single article view. I don't like it too much, but it's a user choice, so I think it's not that risky. There's a note in inline help that tries to explain how it works.

autoreadmore

Let me know if it's what you expected.

Pascal

Thank you so much for adding that! I have tested it and it is what I was hoping for. I have made an update video about that setting - though it won't be live for another 4 hours and 5 minutes from the time of this post.