Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

[SOLVED] Create a Second Article Tab

  • bigk
  • bigk
  • OFFLINE
  • Posts: 22
  • Thanks: 3
  • Karma: 0
9 years 9 months ago - 9 years 9 months ago #260486 by bigk
Hi,

I want to display archived articles for each author under their profile. So is it possible to create a second articles tab, where the only difference is that State=2, instead of 1?
Last edit: 9 years 9 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
9 years 9 months ago #260513 by krileon
Replied by krileon on topic Create a Second Article Tab
You'd have to modify CB Articles, duplicate the tab code, make the needed change to the query then add a new tab in the database to point to your new tab class. In short there's no easy way to do what you're wanting. Plugin tabs are not designed to be duplicated.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: bigk

Please Log in or Create an account to join the conversation.

  • bigk
  • bigk
  • OFFLINE
  • Posts: 22
  • Thanks: 3
  • Karma: 0
9 years 9 months ago #260551 by bigk
Replied by bigk on topic Create a Second Article Tab
Hi Kyle,

Here's what I did, even before posting here

1. Create a duplicate cbarticles plugin named "plug_cbarticlesa"
2. Renamed the php and xml files to cbarticles.php and cbarticles.xml
3. Changed two lines in the cbarticlesa.xml file:
line 3 - <name>CB ArticlesA</name>
line12 - <filename plugin="cbarticlesa">cbarticlesa.php</filename>
4. Created a new DB plugin named "Cb ArticlesA", with element named cbarticlesa and folder plug_cbarticlesa
5. Created a new articles Tab in DB that's an exact duplicate of the original one.
6. I have also updated the query in the articlesa model to State=2.

What am I missing?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
9 years 9 months ago #260587 by krileon
Replied by krileon on topic Create a Second Article Tab
All of the class names in the plugin need to be changed or they'll conflict. This includes the template files as well. Probably easier to just edit the existing CB Articles, copy the cbarticlesTab class, rename it, edit it, then create a new database entry that points to the new plugin class.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • bigk
  • bigk
  • OFFLINE
  • Posts: 22
  • Thanks: 3
  • Karma: 0
9 years 9 months ago #260657 by bigk
Replied by bigk on topic Create a Second Article Tab
Hi,

I'm sorry I'm not understanding what you mean by "copy the cbarticlesTab class". What specific file/line? and hows that different from what I described in my penultimate post?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
9 years 9 months ago #260666 by krileon
Replied by krileon on topic Create a Second Article Tab

I'm sorry I'm not understanding what you mean by "copy the cbarticlesTab class". What specific file/line?

components/com_comprofiler/plugin/user/plug_cbarticles/cbarticles.php

and hows that different from what I described in my penultimate post?

You copied and renamed the files, but didn't adjust the class names. You can't have 2 classes named the same in PHP (unless namespaced, but it's not namespaced).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum