Is there a way to make a block (or custom block plugin) visible only on journal homepage?

Hello guys,

I just got into OJS and started developing an Journal Site for my University. However, they requested me to custom the journal homepage in order to show only some custom blocks (on the side bar) that contain some specific information and put them only on the journal homepage.

I did use the Custom Block Plugin to create the extra content, however they also appeared on every other pages when I added them on the side bar.

I’m thinking about the “hook” (as I successfully used Template::Index::Journal to put some specific content in the middle sections of the homepage through a self-writing plugin), but I can’t find any hook that allow you to put or make blocks visible only on the sidebar of journal homepage.

So, as I stated above, is there any way to achieve this goal?

Thanks in advance.

Hi @Huy,

You’ll need to modify the plugin code to accomplish that. Off the top of my head, you might consider adding a “homepage only” checkbox for each custom block, then having the block check whether you’re on the homepage or not before presenting content depending on the state of that checkbox. I won’t be able to guide you through this in detail, but have a look at the Technical Reference in our Documentation section, and if you get stuck on a detail, feel free to post here.

Regards,
Alec Smecher
Public Knowledge Project Team