Elxis CMS Forum

Extensions => Bots and plugins => Topic started by: seadhna on February 05, 2024, 12:48:25

Title: article plugin
Post by: seadhna on February 05, 2024, 12:48:25
Hi there,
is there any plugin to link to another article in an article? i.e. to feature the image, title and subtitle of another article?
We have the 'articles' and 'superarticles' modules, but creating a module each time I just want to feature one related article seems inefficient.
Title: Re: article plugin
Post by: nikos on February 05, 2024, 20:18:33
You can use the Elxis link (elink) plugin.
Title: Re: article plugin
Post by: datahell on February 05, 2024, 20:52:15
I don't fully understand your question but I believe what nikos proposed might be the solution. However only module Content is able to run plugins (configurable from its parameters) because the other modules do not have a text area field to add large content. So, plugins inside modules make sense only for the Content module.

BTW, Elxis links should be used EVERYWHERE in Elxis. They are portable and multi-lingual. Never use normal fixed links.

Don't do that:
<a href="https://www.example.com/sports/basketball.html">Basketball</a>

Do this:
<a href="#elink:content:sports/basketball.html">Basketball</a>

#elink: denotes the start of an Elxis URI and it is been handled by plugin Elxis link (elink).
Title: Re: article plugin
Post by: seadhna on February 06, 2024, 14:52:38
Hi, thanks for the replies. The elink plugin is for creating a text link. My question is there a way to create a more elaborate link to another article, featuring the image, the date, and the article title.
To do this, I create an ARTICLES module, select the article I want to link to and apply the module to the original article. However, when a website has hundreds or thousands of articles, this gets messy very fast. Hundreds of modules; just to create a "pretty link" to a different article. I was wondering if a plugin might be a better solution - similar to the elink plugin but on the frontend we can see the article image and date and article title.
Title: Re: article plugin
Post by: nikos on February 06, 2024, 15:15:13
You can try the module Articles (mod_articles) as well the module Latest Articles (https://www.elxis.net/edc/content/8.html) which both of them using their parameters give you the possibility to display on frontend articles from various categories, subcategories with different order and other options.
Title: Re: article plugin
Post by: datahell on February 06, 2024, 19:08:43
You want to display an article in a module which has links to an other article, and not to the article you display? This sounds weird. Please show me an example, or write in details what you want to do and how you want this module to look like and function. I might have a solution for you but I need a good explanation on what you want to do.
Title: Re: article plugin
Post by: seadhna on February 08, 2024, 15:28:48
Not a module. I'm wondering if it's possible with a plugin? We have the modules articles and latestarticles and superarticles. These are very useful for showing latest articles or most popular articles. BUT on many articles we might want to feature ONE or TWO specific articles related to the topic. e.g. "Further Reading" / "Read also" / "Dive Deeper" / "Editor’s Picks" recommendations. This is a very common element on the web. The theory behind it is discussed here: https://www.nngroup.com/articles/related-content-pageviews/ However, in this explanation, written in 2014, the examples are text links. We have the Relation Key and we have the elink plugin. However, with both of these options, we can only display text links. There is no image, nor date, nor subtitle.

In 2024, web visitors perhaps expect a little better presentation, prettier, more engaging, with images.

Is it technically possible to have a plugin that we could select an article to feature as further reading. But we can see the image and the title and even the date and subtitle.
Why a plugin? Because you mentioned before that if we create hundreds of modules, it will cause performance issues.
If I have a thousand articles and in each article I want to feature two recommended articles as pretty links (with image and date), but in each article, the suggested articles are different, I need to create a thousand ARTICLES modules. This might cause performance issues?

On this article, there is an element in the middle of the article called "Editor's Picks": https://abcnews.go.com/GMA/Wellness/youtube-updates-guidelines-eating-disorder-related-content/story?id=98643811
Screenshot attached.

To achieve this look and feel in Elxis, we must create a module. But the three articles we want to show may never need to be shown again on any other article. We might have to create hundreds or thousands of copies of the articles module. That's why I'm wondering if a plugin could do this job?
Title: Re: article plugin
Post by: nikos on February 08, 2024, 20:49:42
Looking your example, you could do it with use of Plugin Include module (https://www.elxis.net/edc/miscellaneous/117.html) in combination with Module Articles and Relation key. So let's suppose you want to show as Editor’s Picks 3 articles which they have as Relation key the word 'monument'. You create a copy of Module Articles with title Editor’s Picks and at the Parameters you select as Relation key monument, as Layout 1 column, Limit 3, below you set Caption Yes, Image Thumbnail left and you save publishing the module at hidden position. Then you go into the article where you want to show these 3 articles and at the end of text you insert the Plugin Include module where you select the module which you created. And is done.
Title: Re: article plugin
Post by: seadhna on February 09, 2024, 00:11:31
Thanks Nikos. What you say is correct. This method and other methods already exist to achieve this functionality and look and feel. However, we are still creating a new copy of a module just for a one-time use on one article. Its clunky and possibly affecting performance if we do this anew every article.

Here is my dream scenario: with the new Directory component, we can embed a “listing” in an article with a couple of clicks to choose the directory plugin and specify a listing ID.

Imagine this process but to feature a link to another article.

In your example workflow we decide we want to feature articles X, Y and Z as further reading, within a new article A. we give X, Y and Z the relation key ‘monument’.

But next we create article B, and on this article we want to feature articles Z and C. C has a different relation key “sculpture”.

Relation key is limited to one per article. if we have a site with thousands of articles, it would be much better just to specify article IDs instead of tags or relation keys or categories.

Of course we can code it manually in the article, picture X, title X and the link. What I imagine may not be possible but it would be super efficient and would allow non-coders to easily recommend other articles that might not share a relation key or category.
Title: Re: article plugin
Post by: datahell on February 09, 2024, 19:15:06
As @nikos showed you can already achieve this result. However on mass scale it is not practical. To make a conclusion, you need the following, correct me if I am wrong:

You want a way to display related articles in an article page. If you want to show this block inside the article we need a plugin. If you want to display this block below the article, or next to it in a side column, we need a module. So, question number 1: Which one you prefer, a module, or a plugin?

Now, we want to do this with minimum user interfere. Ideally fully automatically. We can do that. Elxis has the power to include plugins in articles without even been integrated into the editor (like the Structured data (https://www.elxis.net/edc/content/179.html) plugin). So, you just publish the plugin and create automatically the content for you in a pre-defined article position (eg at the bottom of the article). A module can also do that. It can detect the ELXIS_ARTID constant and load the related content automatically.

In order to make it fully automatic we must be based to something like the "relation key". The relation key has been integrated exactly for such cases. Other ways to display automatic content can be: a. display other articles from the same category, b. display latest articles, c. random, etc. If you need full control on which articles to display then we need either to manually integrate the plugin, or to have an administration interface where we can related articles to each other in a custom way. An other option would be to include this functionally in Directory plugin (https://www.elxis.net/edc/content/183.html), I don't know if this is better for you. Pros and Cons of each solution:

Automatic integration
Pros: 0 user effort, publish once, work for ever
Cons: You don't have full control on what it displays

Manual integration
Pros: Full control on what to display
Cons: Some effort is needed by the editor on each article

So, question number 2: Which one you prefer? How do you want to pick the related content?

My proposal is a plugin which gets integrated fully automatically and load content based on the relation key. You could have parameters in the plugin to exclude some articles if you want, although it might not needed as you can just don't use a relation keyword in these article. In any case I will develop this extension for you and release it on elxis.net.
Title: Re: article plugin
Post by: seadhna on February 09, 2024, 19:28:33
Hi datahell, that would be amazing if you can develop this extension!

Answer to question 1: I would much prefer a plugin.
Answer to question 2: I would much prefer manual integration; to have full control over where and what to display; i.e. where on the page, and which specific articles to link to. The idea is that this would be a human-curated listing of specific articles that might appear on some articles but not on others and the specified articles might not share any relation key or category or tags. It would be a manual alternative to the automatic modules that already exist. With the plugin, you could specify an ID; or choose from a list - whatever you think is best.

This is great news that this is possible! :-)
Title: Re: article plugin
Post by: datahell on February 29, 2024, 19:56:59
The plugin is under development :)
Title: Re: article plugin
Post by: seadhna on February 29, 2024, 20:17:44
 ;D Terrific!
Title: Plugin Editor picks
Post by: datahell on March 02, 2024, 21:36:43
The plugin Editor's picks is ready, you can download it from EDC (https://www.elxis.net/edc/content/185.html).
4 different integration methods are supported. Check the plugin's parameters and pay attention to the integration options on plugin management window.

From plugin's help:

Supported integration methods
1. Display specific articles.
Provide the IDs of the articles you want comma separated. Example:
{editorpicks}1,4,7,12,91{/editorpicks}

2. Display category's articles.
Provide the ID of the category from which you want to load the latest articles. You can also type 0 to display articles from the same category as the integration article. Examples:
{editorpicks}category:0{/editorpicks}
{editorpicks}category:2{/editorpicks}

3. Display articles related with a keyword.
Provide a relation keyword. Articles having the same relation keyword will be displayed. Example:
{editorpicks}relkey:elxis{/editorpicks}

4. Display related articles.
Displays the related article to the integration one. This method also uses a relation keyword but you dont have to provide it. Example:
{editorpicks}related{/editorpicks}
Title: Re: article plugin
Post by: michalis1984 on March 03, 2024, 22:59:22
Very good plugin. I didn't knew i need it until it appears.  ;D It can make life easier. Thank you datahell.
Title: Re: article plugin
Post by: sdr on March 05, 2024, 15:01:13
https://picallow.com/editorpick/ (https://picallow.com/editorpick/)

unfortunately there is nothing showing up - Why?
I have published the plugin and set in the module "Execute content plugins" to yes!

Help please...
Title: Re: article plugin
Post by: datahell on March 05, 2024, 20:58:57
It works only inside Elxis articles, not in modules, or else.
Title: Re: article plugin
Post by: sdr on March 07, 2024, 02:15:06
ok, but how can I show it on the front page then - or is that not possible?
Title: Re: article plugin
Post by: datahell on March 07, 2024, 19:27:22
The plugin has been designed to be used inside articles. From the 4 integration methods only the 2 of them would work in a module. The layout and style also are suitable for in-article integration only. It wont be displayed good in a module even if I allowed that. In case of inside-module integration I must re-design the style for the data to be displayed nicely. So, I might update the plugin in the near future to allow inside-module integration, but for now this is not possible.

@michalis1984: I also used it in my site although I didn't have such intentions. It looks really good inside articles.
Title: Re: article plugin
Post by: datahell on March 10, 2024, 21:08:40
@seadhna: You didn't told me if the plugin was OK for you. Are you happy? I want to see happy people :)
Title: Re: article plugin
Post by: seadhna on March 12, 2024, 19:33:37
Hi datahell, this plugin is AMAZING! It's super useful. Great work!
It's great to have many options for how to choose which articles to feature.
It doesn't seem to be possible to feature the date of the article, but maybe there's a reason for that.
Title: Re: article plugin
Post by: datahell on March 12, 2024, 20:13:01
You told me nothing about date. I built it as the sample you show me, but I added more things like the different integration methods to make it more flexible. I am happy you liked it. I also use it in my site, it's nice.
Title: Re: article plugin
Post by: seadhna on March 13, 2024, 19:18:11
It's super. Amazing as always!