We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question

Renaming template tag ID's :)

Hi there,

since upgrading to Perch 3 I'm getting this:

 Template tag ID ‘project-title’ contains disallowed characters
 Template tag ID ‘project-title’ contains disallowed characters
 Template tag ID ‘project-title’ contains disallowed characters
 Template tag ID ‘project-description’ contains disallowed characters

I'm super willing to fix this, but I probably can't just rename this in my template since the content won't know where it belongs to anymore right? Any other way to to this?

Nils Borgböhmer

Nils Borgböhmer 0 points

  • 1 year ago
Simon Clay

Simon Clay 127 points

Hi Nils, yes, dashes have never been permitted in IDs.

I realise you may have a lot of posts to fix, but I would probably approach this by adding the correct ID beside the incorrect ID. Then login into Perch admin and copy the content from the incorrect ID to the correct ID field, then when all done, remove the incorrect ID. Like this...

Change this

<h1><perch:content id="project-title" type="text" label="Project Title" required="true" title="true" /></h1>

to this

<h1><perch:content id="project-title" type="text" label="Project Title" required="true" title="true" /><perch:content id="project_title" type="text" label="Project Title" required="true" title="true" /></h1>

Then login to Admin and transfer the content from the old field to the new field. Then remove the old field.

<h1><perch:content id="project_title" type="text" label="Project Title" required="true" title="true" /></h1>

A bit of a pain I know, but it's the best way I can think of.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If it's currently working then I'd probably not bother fixing it. Just be aware of the potential to need to fix it in the future if things break.