Jump to content
This topic contains 31 posts. A summary containing the most significant posts is available

Featured Replies

Posted

Why can't we edit template files in v5?

Like seriously, what was the reasoning for that?!

Hi @simonle,

There has been a major revamp when it comes to editing themes.

If you haven't already, have a read through the following blog entries. I personally feel the team have done an amazing job and you'll find it to still be as powerful for your community.

What in particular do you want to edit that you cannot do?

  • Author

I honestly thought you just had improved on the theme builder for those who can't or don't want to edit the template files directly.

But why remove the template editor in the ACP?

I want to edit my template files to be able to add or remove stuf. That's not hard to figure out. That's just basic stuff for a CMS.

This is seriously a deal-breaker for me.

Will you add back the template editor in the ACP?

If not, I seriously think I will revert back to v4 and stop paying for this software.

  • Community Expert

Sorry to hear you're unhappy with the changes there, but before you jump, what specifically are you trying to do, that you believe you cant do? We have had very very very few instances where people haven't been able to add things to templates that they have not been able to do before, and I want to try and help you if I can. In most instances its not a case of "cant", its just a case of it being done differently.

  • Author

I obviously want to be able to add, remove and edit content and code in the <head> element as well as different parts of the website. The template editor in the ACP was a good tool for this and it allowed me to fully customise my community.

The editor seems to be available for Pages templates, so why did you remove it for the other template files?

  • Community Expert
  • Management
 

I honestly thought you just had improved on the theme builder for those who can't or don't want to edit the template files directly.

But why remove the template editor in the ACP?

I want to edit my template files to be able to add or remove stuf. That's not hard to figure out. That's just basic stuff for a CMS.

This is seriously a deal-breaker for me.

Will you add back the template editor in the ACP?

If not, I seriously think I will revert back to v4 and stop paying for this software.

When you're presented with a new way of working, it can be daunting and your first thought might be to reject those changes without investigating further.

However, you can still do most of what you need with our template hook system which allows you to add your custom code to preset points within our templates.

While editing templates was very convenient, it also had a lot of overhead in that processing those templates was slow effectively converting text to executable code on the fly with every click hundreds of times per page load. It was also very easy to break your community with a misplaced variable or bad edit. Upgrading was a chore because those with heavily customised templates had to either not have the latest fixes or work through a three way diff to figure out what has been changed.

Now, we can pre-compile those templates as executable code, so they are much faster, you no longer have to worry about upgrading and working through changes.

If you let us know what you need, we can point you in the right direction.

 

I obviously want to be able to add, remove and edit content and code in the <head> element as well as different parts of the website. The template editor in the ACP was a good tool for this and it allowed me to fully customise my community.

The editor seems to be available for Pages templates, so why did you remove it for the other template files?

Make sure "Theme Designer" is enabled in ACP > Themes.

CleanShot 2025-02-19 at 10.10.28@2x.png

Then head to Theme Designer: Templates:

CleanShot 2025-02-19 at 10.11.20@2x.png

Then Create a new template, choose the hook type and select the following:

CleanShot 2025-02-19 at 10.12.56@2x.png

This will allow you to add any code after the opening <head> tag.

  • Author

Alright, so the answer is no then.

In v5 I have no control over specific template files, and I will only be able to add content by using hooks in a convoluted way and change the layout through what is possible with CSS.

  • Community Expert

You will have no access to directly alter template files, no

  • Community Expert
  • Management
 

Alright, so the answer is no then.

In v5 I have no control over specific template files, and I will only be able to add content by using hooks in a convoluted way and change the layout through what is possible with CSS.

You are able to add your own HTML via template hooks, and you can use the new CSS framework to change layouts, yes.

  • Author
 

You will have no access to directly alter template files, no

A straight answer, thank you.

  • Matt changed the title to Edit template files

I like it, makes sense and extensible. Any wiki to use or examples?

Im setting up my first for an individual topic row and the forums_front_forums file is passing in the $rows variable. Any idea how to get the current $row which prob makes more sense?

$return .= \IPS\Theme\CustomTemplate::getCustomTemplatesForHookPoint( "forums/front/forums/topicRow", "topicRow:before", [ $table,$headers,$rows ] );
{{if $row->mapped('pinned') == 1 }}

{{endif}}

Above doesnt work (even after changing the raw file to pass in $row). Read the template doc to make sure im doing it right. Below does work:

{{if 1 == 1 }}

{{endif}}

  • Community Expert

That is a problem in how IPS uses hook points inside foreach cycles. Before we could still access the data with the old theme hooks, but not anymore.

They need to split the HTML into a separate template and call it inside the foreach so we have access to $row. They already made the change for some templates reported before.

thanks $rows works in the template. Do you know why when injecting in different params they are not picked up?

$row is more useful in a foreach, even $rowCount which is available and allows me to get the row from $rows isnt recognised if I extend the array.

We could live with having to use hooks to a point but its really sad there is no way to remove/replace now. That would at least fill in some of the needs.

What’s the use case to remove? You just don’t populate the hook. Replacing can you not just replace the template?

All the customizations I am doing are with the current system and I simply do not see any difficulty in changing certain points or giving a new look to the front-end of the community, even using the hook system.

In less than 30 minutes I understood how it worked, and then I have been creating different pages, adding life according to my needs and tastes in a very efficient, fast and easy way.

It would clearly be better if we had access to the models in a broader way, but the current system allows us to achieve identical results as long as we do it in a different way.

The world of programming is like this and I heard this so often from my teachers, just because we follow a new path in a different way does not mean we will not get the desired result.

It is a matter of adaptation, adapting to the new is often bad.

But often the new can give you a new range of options and ideas!

❣️

Fantastic, so how do you use the row object in a hook inside the loop?

Happy with any paradigm of development.

Currently I’m having to put the code I need outside of the hook inside the source code while I then need to track when upgrading.

Problem I've seen so far is most of the forums on v5 so far look the same, when we could edit templates it allowed for more customization

I’ve separate pinned and normal topics which is a start, but to do this in a templatised way I need access to the row object.

IMG_1860.jpeg

  • Community Expert
 

Fantastic, so how do you use the row object in a hook inside the loop?

Happy with any paradigm of development.

Currently I’m having to put the code I need outside of the hook inside the source code while I then need to track when upgrading.

Could you elaborate on what code you need to add? There might be another way of doing this (possibly with a UI Extension).

interesting thanks @Esther E.

These are the changes - im not able to add into the hook because there is no access to the $row objext: "forums/front/forums/topicRow", "topicRow:before"


\static\templates\forums_front_forums.php | 2810

if ( $row->mapped('pinned') == 1 ):
	$isPinned = TRUE;
else:
	if ( $isPinned == TRUE ):
$return .= <<<IPSCONTENT

<li class="ipsData__item ipsData__item--seperator">
<span><strong>Forum threads</strong></span>
</li>
IPSCONTENT;
		$isPinned = FALSE;
	endif;
endif;
.ipsData__item--seperator {
    padding: 3px;
    font-size: 14px;
    color: inherit;
    background-color: var(--i-headerSecondary--ba-co);
}
  • Community Expert
 

interesting thanks @Esther E.

These are the changes - im not able to add into the hook because there is no access to the $row objext: "forums/front/forums/topicRow", "topicRow:before"


\static\templates\forums_front_forums.php | 2810

if ( $row->mapped('pinned') == 1 ):
	$isPinned = TRUE;
else:
	if ( $isPinned == TRUE ):
$return .= <<<IPSCONTENT

<li class="ipsData__item ipsData__item--seperator">
<span><strong>Forum threads</strong></span>
</li>
IPSCONTENT;
		$isPinned = FALSE;
	endif;
endif;
.ipsData__item--seperator {
    padding: 3px;
    font-size: 14px;
    color: inherit;
    background-color: var(--i-headerSecondary--ba-co);
}

I'm confused. The above should show up before every pinned topic. Is that what you want?

Thanks, the above shows after the last pinned topic as a divider as I check on the bool flag. There is a hook but this takes a $rows object.

Is there any wiki on UI extensions or anything I can do here without updating the base template?

Recently Browsing 0

  • No registered users viewing this page.