Forum

Thread tagged as: Blog
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't understand your question.

Well, the custom content region was not showing. When I added in another simple region of the same name <?php perch_content('Languages');?> it did load, but loaded twice. So I removed that new one and now it's fine?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Had you created the region in the first place?

Originally but before use in CMS changed to custom content region to send variable into template - doesn't that do the same thing... ?

Drew McLellan

Drew McLellan 2638 points
Perch Support

perch_content_custom() doesn't create a region. You need to use perch_content() or perch_content_create() to do that.

So on this page: https://docs.grabaperch.com/docs/templates/passing-variables-into-templates/ the "...and merged with the regular content." means you need to a standard content tag to load custom content??

As I have said, when we added the normal create content tag it loaded, but loaded twice, so we then removed the content tag again, it then worked, obviously because it's in database now - but I thought the custom content would have done this?

Drew McLellan

Drew McLellan 2638 points
Perch Support

the "...and merged with the regular content." means you need to a standard content tag to load custom content??

I don't understand your question. perch_content_custom() doesn't create a region.

Then why when I have the "perch_content_custom" and "perch_content" the content template loads twice?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Both will output the content of the region - that's their job. perch_content() will also create the region if it doesn't already exist.

If you plan to exclusively use perch_content_custom() then pair it with perch_content_create() to set the region up.

"Both will output the content of the region.."

Then why when I only have custom_content does it not load?

"...then pair it with perch_content_create() to set the region up."

What does this mean? Do you need standard content region to trigger custom content to load?

Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean by "not load"?