Embed Specific Blog Categories Into HTML Page?

Started by empmdk, May 19, 2017, 11:31:57 AM

Previous topic - Next topic

empmdk

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.

Gluz

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().

empmdk

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.

Kindred

No, it really will only work if the file is a PHP file
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Gluz

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?

Advertisement: