-
Posts
1,835 -
Joined
-
Last visited
-
Days Won
21
Everything posted by Nico Knoll
-
Well... not really
-
No, I'm from Berlin and 17 so I don't have a car. But I saw this picture and thought it is a good example
-
I think with this theme I would switch back to processwire as blogging plattform
-
Hold your horses! What are you talking about exactly?
-
Just a "D" on the new cars.
-
Would be BRD. But normally you just use DE for the country as well as for the domain.
-
I would say: "ProcessWire Deutschland" or "ProcessWire auf Deutsch" @Joss: would be ProcessWire DE not FDR
-
Okay, it's not that complicated: Creating a shortcode in code Like in my example above you could for example create a sitemap like this: <?php $shortcode->add('sitemap', function($atts){ if($atts['page'] == '') { $atts['page'] = wire('pages')->get('/'); } else { $atts['page'] = wire('pages')->get('name='.$atts['page']); } function sitemapListPage($page) { echo "<li><a rel='follow' href='{$page->url}'>{$page->title}</a> "; if($page->numChildren) { echo "<ul>"; foreach($page->children as $child) sitemapListPage($child); echo "</ul>"; } echo "</li>"; } echo "<ul class='sitemap'>"; sitemapListPage($atts['page']); echo "</ul>"; }); ?> It's important to use wire('pages') instead of $pages inside the function. Same for wire('config'), wire('input'), ... Use the shortcode At first you have to add [sitemap] inside your textarea. You don't need to activate something spacial like TinyMCE or so for it. Just put [sitemap] or [whatever] (if you have something like "$shortcode->add('whatever', function($atts){ });") inside your textarea or textfield. It won't work automatically. You have to use the function in your template field: (if your fields name is "body") $shortcode = $modules->get('MarkupShortcodes'); echo $shortcode->render($page->body); Any questions left?
-
Panorama Heidenheim - Using tumblr on iOs to post to PW
Nico Knoll replied to Philipp's topic in Case Studies
Here's a part of my latest code. Should help: (I added some comments) if($input->post->save) { $gallery->setOutputFormatting(false); // Get the path for the temp file $tmp_path = $config->paths->assets.'tdotTmp/'; // Create the temp file $filename = $tmp_path.time().'.png'; $handle = fopen($filename, 'w+'); // $input->post->dataUrl is the base64 encoded png image // This line replaces the "image/png;base64," to get the raw base64 $uri = substr($input->post->dataUrl,strpos($input->post->dataUrl,",")+1); $encodedData = str_replace(' ','+',$uri); // Decode the base 64 data $decodedData = base64_decode($encodedData); // write the encoded data in the tmp file fwrite($handle, $decodedData); fclose($handle); // Upload the temp file as a new file in the gallery $gallery->upload_image->add($filename); $gallery->save(); } -
I'll translate the descriptions of the labels in the backend. So it shouldn't be that hard for you
-
I could send you the german files so we would have a default language page layout?
-
You're welcome. But I have no idea why "include_once" isn't working... Anyone?
-
Should be. It's not responsive currently but I think that shouldn't be a problem. It's working in IE, too
-
You have to define all of the shortcodes before you use $shortcode->render(). With $shortcode->render() you can choose the fields you want to be looked for shortcodes like: echo $shortcode->render($page->body) so $page->body would be rendered with shortcodes. You can do this as often as you want means for as many fields as you want. And no there si no way to only allow special shortcodes for some fields...
-
I use a file called shortcodes.inc and include it into head.inc. But you can put this code everywhere in your template. But before calling $shortcode->render() of course.
-
Yes, that's what exactly what this module is for. I also made a contact form and a sitemap with it and stuff like this Here's my sitemap form example: <?php $shortcode->add('sitemap', function($atts){ if($atts['page'] == '') { $atts['page'] = wire('pages')->get('/'); } else { $atts['page'] = wire('pages')->get('name='.$atts['page']); } function sitemapListPage($page) { echo "<li><a rel='follow' href='{$page->url}'>{$page->title}</a> "; if($page->numChildren) { echo "<ul>"; foreach($page->children as $child) sitemapListPage($child); echo "</ul>"; } echo "</li>"; } echo "<ul class='sitemap'>"; sitemapListPage($atts['page']); echo "</ul>"; }); ?>
-
My way of handle it was to create a textarea field and insert the code there directly. In the head.inc I had something like this: <?php if($page->additional_css != '') { echo '<style type="text/css">'.$page->additional_css.'</style>'; } ?> So no extra files were needed.
-
Try set the /site/ folder du CHMODE 777 (write permissions). If it (or parts of it) doesn't have write permission the error log can't be written.
-
It's used in the wiki. And I wanted to use it as a facebook share preview image...
-
Maybe you have a .htaccess problem. Try to replace: Options -Indexes Options +FollowSymLinks with # Options -Indexes # Options +FollowSymLinks
-
There are a lot of ways you could do this. But this how I would do this: I would create a template called "toppages" or "navpages" or so only including the "title"-field. "Aktuellt" and "Matchreferat" would use this template (if you don't need more content for this pages). And for the articles I would create a template called "article". Including "title"-, "body"-, ...-field.
-
Hey, is there a bigger version of http://processwire.com/site/templates/styles/images/pwlogo.png available? (like 400px x 400px)
-
You could create a template called "data" with just an title as "key" and an "value" textfield and create them as subpages of "admin". That's the way I handled month names and stuff like this.