Editing Activity stream layouts

3 years 6 months ago - 3 years 6 months ago #320488 by a.muntean
Editing Activity stream layouts was created by a.muntean
I have made an edit in the container.php

it should change the layout for automatically generated posts for articles.

the code works, but it changes the user generated posts, not the automated ones. It should be the other way around.

code and result attached
Attachments:

Please Log in to join the conversation.

3 years 6 months ago #320491 by krileon
Replied by krileon on topic Editing Activity stream layouts
That's working as intended. You changed the main container for all activity. If you want to change it for specific core activity types then you need to only change the template files in the "core" folder. This was explained in your below topic regarding the article activity template file.

www.joomlapolis.com/forum/153-professional-member-support/242896-cb-documentation?start=6#320464


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 to join the conversation.

3 years 6 months ago #320503 by a.muntean
Replied by a.muntean on topic Editing Activity stream layouts
i tried editing the core file but i don't understand where am I supposed to place my code. I don't see which one is the part that addresses the article autoaction.

Please Log in to join the conversation.

3 years 6 months ago #320504 by krileon
Replied by krileon on topic Editing Activity stream layouts
At the bottom where $insert variable is set is where it's outputting the article insert. That's where you'd need to modify it. I can't help you beyond giving locations or simple examples as we don't provide custom coding assistance here. Unfortunately these template files are still PHP and HTML mixed. This will change in the future where we'll be using exclusively Twig and VueJS templates which will be entirely just structured template files with no PHP.


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 to join the conversation.

3 years 6 months ago - 3 years 6 months ago #320507 by a.muntean
Replied by a.muntean on topic Editing Activity stream layouts
In that case, if you could send me a simple code example so i can see where exactly to change, it would be immensely helpful, please. Just a hello world type of example to see the exact position.

Please Log in to join the conversation.

3 years 6 months ago - 3 years 6 months ago #320526 by krileon
Replied by krileon on topic Editing Activity stream layouts
Your sample is the code itself. Template file location and what to edit in that template file are provided above. There is only 1 usage of $insert in that template file and it's responsible for outputting the article. You'll notice the ->get uses against the article object in the $insert usage. Specifically the following.

Article Title: $article->get( 'title', null, GetterInterface::STRING )
Article Intro: $article->get( 'introtext', null, GetterInterface::HTML )

There is no specific usage for pulling out a single image for you to format it. It's not that simple. You'd need to parse for the image in the introtext, pull it out, then place it in the HTML differently or just hardcode whatever implementation you're needing as you can output whatever you want with $insert.

Your alternative is to just format your article how you want it to display in CB Activity and it'll output like that since it just directly outputs introtext.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.164 seconds

Facebook Twitter LinkedIn