Jump to content

Templates with image fields not rendered after migrating website


Siddhi Jagtap
 Share

Recommended Posts

Hello All,

I recently migrated my processwire website from dev server to the live server. My docroot points to a folder with has site dir, wire dir, .htaccess and index.php which works fine. There are some templates that are not getting rendered post the migration and showing the error of Trying to get property of new url. This is only on a few pages. All was working fine before the migration though.

I have also edited the site/templates/home.php to include a file called ./homepage.php which is essentially the  homepage of my website. This works fine too. However if I want to link the other pages to this homepage's navbar what would the href value look like? For example I want to link a page called about.php (which is in the same directory as homepage.php.), how would I do it? I tried putting ./about.php and even ./about-us(the URL set from the admin panel of processwire for this page)but none of them work. It just pulls the URL as www.mywebsite.com/about.php or www.mywebsite.com/about-us and hence shows an error saying Not Found :The requested URL was not found on this server.  Also I can no longer view any pages from the admin panel as well. It gives the same 404 URL not found error. Did I mess anything up during the migration?

Any help with the above is appreciated.

Thanks.

Link to comment
Share on other sites

  • Siddhi Jagtap changed the title to Templates with image fields not rendered after migrating website

Hi,

i think you should have a closer look at how pw works as i would strlongly advise you not to use aliases (slugs) in the nav as they may change nor to use templates of course

have a look at a simple, very simple nav

<!--
link to the home page
if your website is not multilingual you can simply use
<a href="/">
-->
<a href="<?php echo $pages->get(1)->url; ?>"><?php echo $pages->get(1)->title; ?></a>
<!--
and then a simple list of the other pages
of course, you can exclude some pages ids and put the wole stuff inside an ul or whatever you want
going a little further, i let you guess how to deal with sub menu, easy as soon as you've understood how it works
-->
<?php
$pgs    = $pages->get(1)->children;
foreach ( $pgs as $p ):
$activ  = $page->id == $p->id ? ' class="active"' : '';
?>

<a href="<?php echo $p->url; ?>"<?php echo $activ; ?>><?php echo $p->title; ?></a>
<?php endforeach; ?>

you could also have a look at the menu modules and either use one or understand how they work to make your own

https://processwire.com/modules/process-menu-builder/
or
https://processwire.com/modules/markup-menu/

they offer different way of building menu and can be a good starting point for your own

hope it helps

have a nice day

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...