Advertisement:

Author Topic: Embed Specific Blog Categories Into HTML Page?  (Read 508 times)

Offline empmdk

  • Semi-Newbie
  • *
  • Posts: 20
Embed Specific Blog Categories Into HTML Page?
« on: May 19, 2017, 11:31:57 AM »
I am developing my site with October CMS (HTML templates) and will be wrapping the forum template to match everything later on. For now, my main concern is being able to use my "News" category of forum topics on the homepage and having it seamlessly embedded with the template. Right now, I'm using PortaMx and have a block pulling a specified amount of the posts from those news categories to display on the home portal.

If anyone here could point me in the right direction, I would greatly appreciate it.

Offline Gluz

  • Native Language Support Specialist
  • Sr. Member
  • *
  • Posts: 786
  • Gender: Male
    • Al-eXs on GitHub
Re: Embed Specific Blog Categories Into HTML Page?
« Reply #1 on: May 19, 2017, 03:56:41 PM »
You can use the SSI functions, specifically the ssi_recentTopics() function:

http://www.simplemachines.org/community/ssi_examples.php
https://support.simplemachines.org/function_db/index.php?action=view_function;id=515

If you want to customize the output, then you use the parameter $output_method = 'array' to retrieve an array of the elements and then you construct the HTML template for it to your needs.

The parameter $include_boards is used to specify from where it retrieve the topics.

If you want instead only topics to retrieve just the last posts in that, use the function ssi_recentPosts().
Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en inglés.

Offline empmdk

  • Semi-Newbie
  • *
  • Posts: 20
Re: Embed Specific Blog Categories Into HTML Page?
« Reply #2 on: May 19, 2017, 05:39:57 PM »
I've only been able to get SSI functions to work if, for example, the index file has a .php extension. If it is .html/.htm then php does not function. Is there a way of doing this without getting too crazy? I have tried using .htaccess and adding a handler for parsing html as php and that either doesn't work or forces the browser to download the index file. I know there is a slight performance hit doing it that way as well, so if there's anything else, I'm willing to try it.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 54,677
  • Gender: Male
    • Kindred-999 on GitHub
Re: Embed Specific Blog Categories Into HTML Page?
« Reply #3 on: May 19, 2017, 07:07:37 PM »
No, it really will only work if the file is a PHP file
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Gluz

  • Native Language Support Specialist
  • Sr. Member
  • *
  • Posts: 786
  • Gender: Male
    • Al-eXs on GitHub
Re: Embed Specific Blog Categories Into HTML Page?
« Reply #4 on: May 19, 2017, 07:09:21 PM »
How do your files look like?
How do your files work? They need to be .html explicitly?
How do you call the functions from your files?

And how do you added the handler to the .htaccess?
Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en inglés.