Hi,
I have a little bit problems to set a homepage link for a complex site situation.
My sitearchitecture is:
01-home
02-cityfoo (home of cityfoo)
01-concept
02-imprint
…
03-citybar (home of citybar)
01-concept
02-imprint
…
from home I have links to the both cities. Both city-folders are enclosed websites for it own.
If I’m on one of the city websites I need a homelink but not to the main homefolder but on the home of every city (home of …).
I tried several variations but nothing worked fine or dynamic. Because I need to add new cities from the panel.
Then you could check in your header (or wherever you want to place that link) if the template of the page (or if is is a child page, the parent of the page) uses this template. Something like:
Hi,
actually I have now to update something on this website and now I got for this an error: Call to a member function intendedTemplate() on null
All the last time the website worked without problems and now I installed it locally to make some changes but I get this error.
This is the code:
<?php foreach($site->languages() as $key => $language): ?>
I have no idea what is different on your remote and localhosts, but in any case, the new solution is the correct way of doing this, even if the remote server doesn’t complain.
Because otherwise, if the first condition returns false and there are no parent pages, the second condition will throw the error, because the page object is missing.