-
Posts
289 -
Joined
-
Last visited
-
Days Won
8
Posts posted by marcus
-
-
A) {$pages->find("template=child-template, provincie=$child->provincie")} could result in multiple pages. It's not clear whether you're doing this already, but you'll have to iterate through the results like
$children_provincie = $pages->find("..."); // Replace ... with your selector foreach ($children_provincie as $c) { echo $c->url; }
...and so on.
B) Even if the selector would return just a single result, you have to return ->url to get it working as a link. Thats because, in your second snippet, you just get an ID instead of a path to the page being found.
-
Hi John,
you have to additionally grant edit access to the templates you're allowing your customer to edit.
To do this go to Setup › Templates › (some_template) › Access › Click Yes and then in this row give the new role all intended permissions.
- 2
-
Thanks! I will forward it to my customer.
-
When including your css and js, do you use something like...
<link rel="stylesheet" href="<?php echo $config->urls->templates?>/dist/css/main.css">
...or are you traversing folders like href="../../css/main.css" ?
- 1
-
Hi felix, thanks for the updates on the issue! I haven't found time in the last days to move any further in this project - which is just a learning installation anyway - but will look into TemplateTwigReplace on the weekend. I better be learning twig sooner or later, if not for PW then for Drupal 8
-
- The testing environment is an out-of-the-box MAMP 3 virtual host, meaning PHP 5.5.10 - but I could try to downgrade, since it will really take some time until this version hits my customers web hosters
- Just MarkupSimpleNavigation, ManageFiles, FieldtypeCropImage - just installed, none of them initiated in any form - apart from that the installation is totally empty / unconfigured
- Yeah, different variable name, integer instead of string, but same effect
edit: 5.4.25, 5.3.28 - no difference
-
Hi Felix,
greetings to Hannover and thanks for your answer. die(test) works and proves the dataprovider is loaded at all. But the value of $foo still isn't provided to home. See my code below in both files:
home.php:
<?php /** * Home template * */ echo "This should be the value of foo: " . $foo;
HomePage.php:
<?php class HomePage extends \nw\DataProviders\PageDataProvider { public function populate() { $this->foo = 'bar'; $this->page->foo = 'baz'; //die('test'); } }
But the output is just "This should be the value of foo:", without any 'bar' added.
Overall, its just testing a different way to populate/architect my templates, so no show stopper at all - but thanks for the offer via Skype!
Marcus
-
Hi marco,
unfortunately the example for a home page template, mentioned above, doesn't work in my case.
I installed the module, left the default setting dataproviders, created this very folder in site/templates/ (checked its permissions), placed a HomePage.php with your example code in it, opened home.php and tried to echo $foo. With no result. Am I misunderstanding the concept, or did I forget a neccessary step to make this work?
Thanks in advance!
marcus
PS: PW 2.4, Module version 1.0.2
- 1
-
-
My development workflow / deployment process is git- and beastalkapp-based, and heavily inspired by this video by Chris Coyer from css-tricks.com: http://css-tricks.com/video-screencasts/109-getting-off-ftp-and-onto-git-deployment-with-beanstalk/
Meaning:
- Working locally
- but having a staging server, more or less like the one einsteinsboi has described above
- and having a production server, the clients webspace
Beanstalk handles the deployments which tend to be automatically on staging (just the master branch) and - always - manually on production.
- 2
-
Launched just a few days ago: http://yummimami.de - a presentational website for a German startup supplying healthy and kid-compatible presented food to schools.
Some features
- Responsive
- Forms via FormBuilder
- Navigation via MarkupSimpleNavigation (which, at least in my use case, evolves into something super essential for PW - like Views for Drupal for example )
- Widget handling via having a big pool with pages of template type "widget", then referencing (and hence, rendering) them on content pages
- Editorial influence on the homepage teasers main color via SVG + field + ColorPicker (not necessary to that extent since the customer doesn't need to change the color to any other that magenta, green or brown - but still: proof of concept)
- 13
-
Hi there,
in need for a light knowledge base software and not happy with solutions such as MediaWiki, Dokuwiki or Confluence I decided to try to build such a tool based on ProcessWire. At the moment this profile is lacking of features, but doing well in the context it is created for - a somewhat protected simple knowledge base for internal use.
It has some basic features but I'm aware that there's still way to go. So if anyone is interested, please find the code attached here or on GitHub: https://github.com/marcus-herrmann/ProcessWire-KnowledgeBase-SiteProfile
I exported the data from a PW 2.4 installation, but not have tested it yet against older versions.
Installation
Before running the installer of ProcessWire copy/replace/site-default/install/ /site-default/templates/ /site-default/modules/
with the folders from this zip.ConstraintsIt's not possible to export user roles with ProcessWire's Site Export Module this profiles templates are checking just whether they are accessed by an anonymous or logged in user.Features- Tagging of wiki-articles
- Set articles to globally sticky ( = for all users)
- Personal bookmarking of articles for logged in users
- When using markdown to author wiki-articles, code highlighting via highlightjs
Included modulesHopefully this profile is useful for you in any way.
Best,
marcus
Edit: Forgot GitHub link...
- 26
-
If anyone else also stumbles over this kind of error/phenomenon:
In PW 2.4, SiteExportModule works but fails (running into a 500 error) when there's no site/assets/files folder (I guess this happens rarely, but nevertheless... it happened to me this week ).
After manually creating this folder, exporting continues and runs smooth.
-
Hi Soma,
thanks for this approach! I was kind of thinking out loudly - I hope it wasn't understood as a feature request and totally can understand that you aren't looking forward to adding every special request into the module core. I'll try to implement a hook like this - thanks again for pushing me in the right direction!
Best,
m
-
I'm wondering: is there a way to influence the parent item - like it's possible to influence the current one?
A counterpart of "item_current_tpl", such as "item_parent_tpl"?
-
*facepalm* Thanks! Arrghh....
-
Hi
and once again a newbee question from me... For some reason I am not able to make the following code work. It outputs the navigation not from page 1001 but from the real root, page 1. And I'm scratching my head asking why...
<?php $teaser1 = $modules->get("MarkupSimpleNavigation"); $options = array( 'levels' => false, 'max_levels' => 1, 'show_root' => false ); $rootTeaser1 = $page->get(1001); echo $teaser1->render($options, null, $rootTeaser1); ?>
Can you help me finding out why it ignores my custom root? And yes, 1001 does exist and has non-hidden children nodes.
Thanks in advance!
Marcus
-
*facepalm*
I stepped in the ->first()-trap again... From now on I'll place a post it on my monitor, stating "...have you tried ->first?" or "Try ->first() first before annoying people in the PW forums!"
Thanks!
- 1
-
Hi,
sorry to bother you again -- I'll try not to open topics/asking questions daily The following codes does not work properly and I'm wondering why:
<?php $download1 = $pages->get(1014)->download1;?> <a href="<?= $download1->url?>"> <img src="<?php echo $config->urls->templates?>images/pdf.png" /> </a>
Ressource 1014 has the field "download1" filled with a dummy pdf, and the URL is printed. But nothing more, ->file, ->filename, ->name, ->ext and so on are empty although the file (dummy_1.pdf) can "physically" be found in /site/assets/files/1014/
Have I missunderstood the Cheat sheet/API in some way?
Thanks again!
marcus
Edit: this code is placed in another template, therefore the $pages->get(1014) instead of $page->download1
-
Thank you very much, diogo and arjen!
Concerning the Code editor: I tried it first, but the post preview populated the php-code with divs and spans all over (though I was pasting it from SublimeText) - anyway...
-
Hi there,
for some reason I do not succeed in doing a simple iteration (in this case with images):
<?php$number_of_images = count($pages->get(1012)->images);foreach($pages->get(1012)->images as $image) {$thumbnail = $image->size(118,112);echo "<a href='{$image->url}'><img class='photo' src='{$thumbnail->url}' alt='{$image->description}' /></a>";if ($number_of_images % 3 == 0) { echo "<p>Insert</p>";}}?>In this case, there a 5 images attached to 1012, if I echo $number_of_images inside the foreach loop it prints "5". But on the other hand this variable doesn't react on my "$number_of_images % 3 == 0", meaning that it does not insert the <p>...-Chunk every 3 images.Can you help me to find the error in my approach or code?Thanks in advance!marcus
Module Release: Facebook login
in Modules/Plugins
Posted
Hi apeisa,
for a hobby horse project of mine - and to learn writing modules - I took the liberty to adapt your module for GitHub registration/login:
https://github.com/marcus-herrmann/ProcessWire-GitHubLoginModule
GitHub is using OAuth as well, so I had to more or less modify the URLs (and for some reason, giving a stream context to file_get_contents).
Disclaimer: untested so far! Proof of concept.