-
Posts
469 -
Joined
-
Last visited
-
Days Won
1
Posts posted by Gideon So
-
-
Hi @rooofl
I think you need to use the dot (.) sub field notation in your selector string.
something like
$page->font_style.type = somevalue
The font_style is the repeater field and the 'type' is the field in the repeater field.
Gideon
- 1
-
- 2
-
Hi @Roych
You add the JS script within the foreach loop. That means the same script include jn the page many times. I think the JS script should reside outside the foreach loop.
Maybe place the script just before the closing body tag </body>.
Gideon
- 1
-
Hi @Jim Bailie
I think you can use the Page Reference field. And then loop the page reference field to show the content of the selected page.
For example, I add a Page Reference field named other-page-content.
I can add the following code to my main template
<?php foreach($page->other-page-content as $other-page) { echo "<div>"; echo $other-page->your-content-field; echo "</iv>"; }
Hope this help.
Gideon
- 1
-
How about this:
<?php $userloggedinname = $user->name; $pagename = $page->name; $redirecturl = $pages->get(1)->httpUrl . "medlemmar/" . $userloggedinname; { $session->redirect( $redirecturl ); } ?>
Gideon
- 1
-
Hi @johnners
1. Create a new template whatever name you think fit, such as update-home-body.
2. Create a page and assign the template created above to it.
3. Create a new template php file named the same name as the template created in step 1 such as update-home-body.php in the site/template folder.
4. Put the following code in the template file.
<?php
$home = $pages->get(1);
$home->of(false);
$content = "whatever you want or read it from somewhere";
$home->body = $content;
$home->save();
5. Create a cron job to access the page at the designated time.
Hope this helps.
Gideon
?>
- 1
-
- 1
-
Hi @Arcturus
On the road, this just comes out of my head. Try adding target='_blank' to the a tag link to the pdf file
Gideon
-
Hi @joe_g
$pages->addHookAfter('added', function(HookEvent $event) { $pages = $event->object; // The page that is being added $page = $event->arguments(0); // If the page passes some kind of test if($page->template == 'your-template-name') { // Set the sort value for the new page to zero (sibling sort will be automatically adjusted) $pages->sort($page, 0); } });
Put this piece of code into the ready.php.
Hope this help.
Gideon
-
-
Very much curious about what it is. Ryan has always surprised me in the past and looking forward to the new surprise.
Gideon
- 2
-
- 1
-
Hi @jploch
I have the following JS error in the console.
Failed to load resource: the server responded with a status of 404 (Not Found) fieldsettings.css Uncaught Error: [HMR] Hot Module Replacement is disabled. at Object.<anonymous> (main.js:1:273800) at Object.<anonymous> (main.js:1:273857) at i (main.js:1:110) at Object.<anonymous> (main.js:1:220711) at Object.<anonymous> (main.js:1:220891) at i (main.js:1:110) at Object.<anonymous> (main.js:1:273910) at i (main.js:1:110) at main.js:1:902 at main.js:1:912
And I see a lot of this error:
Failed to load resource: the server responded with a status of 500 (Internal Server Error) __webpack_hmr
Any reason why I saw all this error?
Gideon
P.S. I am using version 0,4 and install in a sub-folder.
-
- 2
-
- 1
-
Hi @Nomak
I think you don't need to use these library to access the shopify api.
Take a look at the following link:
https://gist.github.com/calufa/c575b31291bb000fbf59
Gideon
- 2
-
Hi @bilioso
You need to set it in the image field setting.
You can find the setting in the "Input" tab.
Gideon
- 1
- 1
-
All page array in ProcessWire is PaginatedArray. Is the following suit your need?
$array = $wireArray->getArray();
Get a PHP array of all the items in this WireArray with original keys maintained
https://processwire.com/api/ref/wire-array/get-array/
Gideon
-
How about this?
<?php $pageArray_a = wire('pages')->find('template=release,name%=a'); $pageArray_b = wire('pages')->find('template=release,name%=b'); $pageArray_a = $pageArray_a->append($pageArray_b); ?>
Gideon
-
Hi @Martinus
15 hours ago, Martinus said:But, do I need to check with if($item->hasChildren ? Because the IF does not work.
No. I don't think you need to check if the page has children.
Gideon
-
Seems like a useful plugin. Thanks for sharing your work with the community. If there is a video to show how it works would be very useful.
Gideon
- 4
-
Hi @Roych
You may need $page->next()
https://processwire.com/api/ref/page/next/
if($page->next()->id) { // Code with Sidebar } else { // Code without Sidebar }
Gideon
-
Hi @Micthew
It means $imagesAvatar always return a value. try replace $imagesAvatar with $page->images in the third line of your code and see if it works.
Gideon
- 1
-
Hi @Roych
Did you remove the page reference field in the gallery template and create another page reference field in the event template? Otherwise my code above won't work.
Gideon
Can I return next 5 pages and previous 5 pages?
in Getting Started
Posted
WOW! Learn something new.
Gideon