48 posts in this topic
Recently Browsing 0 members
No registered users viewing this page.
I want to extend PagesType to get a new `Product $products` variable in the API. Problem is, I have about a million (well, about 50) different templates for the products so `addTemplates()` can be difficult. Without a template, `pagesType` throws notices (`Trying to get property of non-object in wire/core/PagesType.php on line 161`). Is there a way to extend `pagesType` without specifing templates or by specifying a template group?
I have created a template and will create several pages with it.
One block on these pages is always the same text that I need to reuse. But it should be editable.
What is the appropriate way to achieve this?
I thought I might create a separate template and create a page with it. Then include that page into the other pages via a field.
But I could not find a field that is working like this.
Any help is appreciated!
I have a hook to change the template file on a certain page. This is not working at the moment for some reason.
The usual location to place templates is under /site/template. Because the template should only be available in my module, I want my template file to be in /site/modules/mymodule/view/mytemplate.php
When I place my file in the usual template location, it works fine. But when I place the file in my module folder, it doesn't work. When I var_dump the $page->template->filename variable, the location of the template file is correct and maps to my module folder. So everything seems to be correct, but somehow it's not working but I can't figure out the problem.
Does anyone know how to solve this?
Hi, excuse me but I need any suggest...
I want to create 1 page of my site with 200 plants, 200 description and 200 link to another page.
I begin put in 1 Template 2 field-text, and I see that it appear in Field-List!
If I create 200+200+200 field... I see all in tha list!
If I create 200 article by filed-textarea, I don't see it in Field-List!
I create yet 75 article in 75 pages, but I don't see it in Field-List!
What I don't understand? :/
By Martin Muzatko
I searched a lot to find various solutions to the problem of setting a custom publish date. Which is a must if you do a redesign of a website and need to write import scripts. Since I can't re-use the database.
I understand that there is no field to set the dates for created/modified/published manually, but this should be at least possible with the page API.
So I tried to set the published date via API:
$page->of(false); $page->published = 1486297829; $page->save(); Which did not work, whenever I ask for $page->published, I get the date back that was first set when publishing the page.
So I researched a little more and found that the Page class stores the published date in $page->settings['settings']; (see Github)
I also tried $page->set('published', 1486297829); but with no success.
Is it possible that this has to be done via SQL? Why? Why can't I use the API? Or do I miss anything?
Thank you a lot in advance!