-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By Piguanet
Hola, soy bastante nueva en esto. Tengo en la papelera de mi CMS 4300 aprox. archivos que no puedo borrar. Cuando le doy la opción vaciar me dice que no se puede y continuan ahi.
-
By tron1000
Hello! I use PW 3.0.98 and I have frontend editing enabled for a PageTable Field. Somehow, when I double click the field in the frontend, the iframe in wich the content is displayed is very small (see screenshot). I couldn't find out if thats some CSS conflict or another problem. Any suggestions? Thanks, Andrej
-
By Noel Boss
I use a PageTable field to make edits to children of pages more intuitive…
To register the hooks, insert the following Snippet inside your init function in your module (or add it to your init.php file):
/** * Initialize the module. * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. */ public function init() { // Prefill pageTable field $this->wire()->addHookBefore('InputfieldPageTable::render', $this, 'addChildrenToPageTableFieldsHook'); $this->wire()->addHookBefore('InputfieldPageTableAjax::checkAjax', $this, 'addChildrenToPageTableFieldsHook'); } Then, add this hook method:
/** * Fill pagetable fields with children before editing…. * * @param HookEvent $event */ public function addChildrenToPageTableFieldsHook(HookEvent $event) { $field = $event->object; // on ajax, the first hook has no fieldname if (!$field->name) { return; } // get the edited backend page $editID = $this->wire('input')->get->int('id'); if (!$editID && $this->wire('process') instanceof WirePageEditor) { $editID = $this->wire('process')->getPage()->id; } $page = wire('pages')->get($editID); // disable output formating – without this, the ajax request will not populate the field $page->of(false); // you could also insert a check to only do this with sepcific field names… // $page->set($field->name, $page->children('template=DesiredTemplate')); // just specific templates $page->set($field->name, $page->children); } Now whenever there is a page-table field on your page, it gets populated with the children
-
By pppws
Hey there,
i've set up a page wich uses pageTable and it works like a charm.
for my home page i get several pages. they are sperated in two types:
a) page has the module 'featured_img'
b) page doesn't have the 'featured_img'
my pageTable field is called add_modules. so i was wondering if something like
<?php foreach ($featured as $child): ?> <?php if ($child->add_modules->module_featuredimg): ?> // show image <?php else: ?> // show text <?php endif; ?> <?php endforeach; ?> is possible?
thanks for your input!
-
By celfred
Hello,
I have a feeling I'm missing an easy thing here (again...). If I trash a page from API with :
mypage->trash()
Is there a simple way to restore it if needed ? I can do it in back-end, but I'd like to do it through API with something like
mypage->restore()
but this doesn't exit
So if you can give me a little help on that, I'd appreciate. Thanks in advance !
-