Forum

Thread tagged as: Problem

Wrong preview path

I have a onepage with different sections. They are organised them with «set_page» in the region section of the backend to have a better overview. Now when I click «Page preview» in a section I see the page without CSS styles, it gives out the following link: https://www.domain.ch/index.php/section_name. In fact the website path is https://www.clixx.ch/index.php/

The path for the first section is correct, in the page options under Path it shows «/index.php».

All other sections show «/index.php/section_name» what does not show the CSS styles. Seems that they are treated as subpages what they are not... The Subfolder path there is «/index.php».

Any idea? Should the path not be «/index.php/#section_name»? But what is when I change this? Will the content disappear? Why is the path wrong?

Thanks a lot!

Martin Stettler

Martin Stettler 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What value have you set for the single item URL in the region settings?

Inside the index.php file I set: <?php PerchSystem::set_page('/index.php/section_name'); ?>

That's probably wrong? When yes, can I change without loosing content?

Thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

In the region options, what value have you set for "URL for single items"?

I have only Location > Path, which is for a section '/index.php/section_name'. Where do I find "URL for single items"?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

In your Region Options.

  • Log into Perch
  • Find your page and region
  • Click 'Region Options'

In the region options, what value have you set for "URL for single items"?

Ok, sorry I was in page options... So, there is nothing set for "URL for single items". What should it be so for a section in a onepage? Just #section_name?

Many thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, try something like /#contact for example.

Ok, this works for a region inside a section. But, my problem is that the section preview (show page one level higher than you mean) is without CSS styles. When I change the path there, of course all that content will be deleted! So I think I have to change these links from «/index.php/contact» to «/#contact». Is there a way to do without loosing content?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't understand what you mean by the content being deleted. You'd have to delete the content yourself for it to be deleted.

If your CSS isn't displaying, that's probably just down to the path you're using to reference it. Is the path root-relative?

I organise the sections in different regions for a better overview in the backend using your solution of «set_page».

Staying in your example (section «contact») I show you what I have for each section:

<?php PerchSystem::set_page('index.php/contact'); ?> <section id="contact"> <!-- some content --> </section>

This gives to me in the page section of Perch the following Location > Path: «/index.php/contact» of course. But I think it should be «/index.php#contact», right? Now, the problem is, when I change that my content of the contact section disappears...

Drew McLellan

Drew McLellan 2638 points
Perch Support

After changing the location, go into Perch and update the page path to match.

That's it. And nothing is deleted. Thanks a lot! :-)