Show ID of articles Topic is solved

For Joomla! 4.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
abomareya
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Mon Sep 19, 2022 12:56 pm
Location: Egypt
Contact:

Show ID of articles

Post by abomareya » Tue Oct 04, 2022 11:11 pm

I want to show the article ID below the title, in the area where the article information appears, such as publication dates, number of views, author, etc.

What is the code needed for that? And where do I put it?

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2626
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Show ID of articles

Post by ceford » Wed Oct 05, 2022 4:07 am

Create a template override of layouts/joomla/content

You will find the layout in html/layouts/joomla/content/info_block.php

The item id is obtained with $displayData['item']->id;

You will have to figure out how to use it using the the other items in info_block.php as a guide.

abomareya
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Mon Sep 19, 2022 12:56 pm
Location: Egypt
Contact:

Re: Show ID of articles

Post by abomareya » Wed Oct 05, 2022 7:17 am

ceford wrote:
Wed Oct 05, 2022 4:07 am
Create a template override of layouts/joomla/content

You will find the layout in html/layouts/joomla/content/info_block.php

The item id is obtained with $displayData['item']->id;

You will have to figure out how to use it using the the other items in info_block.php as a guide.
Thanks a lot , I did it

slhuilli
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Wed Feb 02, 2022 10:57 am

Re: Show ID of articles

Post by slhuilli » Wed Oct 05, 2022 6:23 pm

I have written a module for J3 for that.
If you are interessed, I can send it to you
I have nevers tested it on J4

abomareya
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Mon Sep 19, 2022 12:56 pm
Location: Egypt
Contact:

Re: Show ID of articles

Post by abomareya » Sun Oct 09, 2022 12:34 pm

slhuilli wrote:
Wed Oct 05, 2022 6:23 pm
I have written a module for J3 for that.
If you are interessed, I can send it to you
I have nevers tested it on J4
Yes i am interested , i need module showing the articles from some categories with showing the ID as option , but sure for J4
Greetings and Appreciation

abomareya
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Mon Sep 19, 2022 12:56 pm
Location: Egypt
Contact:

Re: Show ID of articles

Post by abomareya » Sun Oct 09, 2022 1:07 pm

ceford wrote:
Wed Oct 05, 2022 4:07 am
Create a template override of layouts/joomla/content

You will find the layout in html/layouts/joomla/content/info_block.php

The item id is obtained with $displayData['item']->id;

You will have to figure out how to use it using the the other items in info_block.php as a guide.
I want to thank you again for the help,

Now I want to show the article ID below the article title in the articles list that are created via the lists feature by selecting Category List (from menu) ....

Sure I hope to show the ID as a separate column in the table, but I don't know what the possibility is to do that
Greetings and Appreciation

slhuilli
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Wed Feb 02, 2022 10:57 am

Re: Show ID of articles

Post by slhuilli » Sun Oct 09, 2022 4:42 pm

I don't have J4 installed for testing.


Locked

Return to “Joomla! 4.x Coding”