user2567016
user2567016

Reputation: 33

Add div element if class is present

Wanting to add a div element if a class is present on the page.

This is for IPS forum software. Reached out to them about this and their response was that they would charge for a custom theme design. Would rather do this myself if possible (bit too expensive otherwise).

I want to display a specific div for the "compose new private message" modal popup without displaying it on all other modal popups. Can't use body page controllers so I'm guessing my only option, other than having the PM modal inherit from a new template, would be to try and display a div if a certain class exists.

Upvotes: 0

Views: 68

Answers (2)

Ice76
Ice76

Reputation: 1130

I would recommend a Plugin with a theme hook. You can put your logic in the php file and assign your hook to show up exactly where you want it.

Upvotes: 0

gview
gview

Reputation: 15361

Templates are stored in the database for IPB. You can utilize the Admin system to go in and edit the templates. There is an extensive series of menus that give you access to individual template code, for example, under Messenger, there is sendNewPersonalTopicForm, PMQuickForm, and sendReplyForm.

It should be relatively easy to go into those templates, find the markup you want and add a container div where appropriate.

For example, for a 3.x board, you find something like this:

<div id='message_compose' class='post_form'>
    <form id='msgForm' style='display:block' 
    action="{parse url="module=messaging&amp;section=send&amp;do=send" base="publicWithApp"}" method="post" enctype='multipart/form-data'>

This seems fairly simple code to alter.

Upvotes: 0

Related Questions