Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

When writing a custom PHP page in Joomla, how do I include CB components?

  • kpd10435
  • kpd10435
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
11 years 5 months ago #227821 by kpd10435
Hi,

I would like to include the content from things like the latest forum posts / wall tabs elsewhere in my site in a custom PHP script. Anyone have an example how I would declare the proper global variables, instantiate a class and get the HTML into a variable so I can use it where I want ? ( Ie, I want to make my own custom profile via a Joomla Article and include CB components )

TIA,

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
11 years 5 months ago - 11 years 5 months ago #227913 by krileon
For the most part you include static tabs perfectly fine, but some of them likely won't work properly. Especially tabs with posting capabilities as they'll send the user to their CB profile on post. You also don't need PHP in an article for this. Install our CB Content Bot, which allows substitutions in a Joomla article, then use the below tutorials for substitutions to add tabs/fields to the article as needed.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb

www.joomlapolis.com/support/tutorials/107-use-cases/18354-substituting-tabs-as-fields

For custom profiles you should use tab positions and CSS to have the layout you want. You can also modify CBs template PHP file below as needed. You can also try looking into CB Profile Pro which allows customizing the profile, but there's mixed results with it.

/components/com_comprofiler/plugin/templates/default/default.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.
Last edit: 11 years 5 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum