biber
Members-
Posts
93 -
Joined
-
Last visited
Everything posted by biber
-
Hi, i've built a site for my wife http://malabu.de, which is fairly ready to show. But when I try something new it happens the whole site is temporarily damaged, because I'm still a newbie in php. Is it possible to show the same site simultanously stable for guests and with my experiments for logged-in Users? I think about something like a subdomain, but I don't know how to realize it without dublicating the whole content. Any ideas?
-
Hi Steffen, thanks a lot for your help, this solved my problem. Günter
-
Thanks for your help. I didn't find a module "TextformatterNewlineBR" but one called "TextformatterAutoParagraph", which seemed to comply with my request. As you described I installed it and added it to the textformatters box, but above the "HTML Entity Encoder" and --Yippee!-- all texts are formattet properly. @ Kixe: Thanks for your suggestion. But the simple way netcarver showed me just fixed my problem, so I did not try to find another solution. Great CMS - Great forum Günter
-
Hi, is it possible to force a line break in an image description field? I'm building a site with a gallery of cooking recipes. Each photograph shows one dish and in the description I write the ingredients and the preparation. But even if I use line breaks while filling the field, it comes without that. Thanks in advance Günter
-
Hi, I habe buildt a site with a recursive menu like mindplay.dk posted here: https://processwire.com/talk/index.php?app=forums&module=post§ion=post&do=reply_post&f=2&t=110&qpid=28241 But now the script produces a double </li> element after the nested <ul> Here is my code: <ul> <?php // top navigation consists of homepage and its visible children $homepage = $pages->get('/'); $children = $homepage->children(); // make 'home' the first item in the navigation $children->prepend($homepage); /** * Recursive traverse and visit every child in a sub-tree of Pages. * * @param Page $parent root Page from which to traverse * @param callable $enter function to call upon visiting a child Page * @param callable|null $exit function to call after visiting a child Page (and all of it's children) */ function visit(Page $parent, $enter, $exit=null) { foreach ($parent->children() as $child) { call_user_func($enter, $child); if ($child->numChildren > 0) { visit($child, $enter, $exit); } if ($exit) { call_user_func($exit, $child); } } } visit( $pages->get('/') , function(Page $page) { echo '<li><a class="men" href="' . $page->url . '">' . $page->title . '</a>'; if ($page->numChildren > 0) { echo '<ul>'; } } , function(Page $page) { echo '</li>'; if ($page->numChildren > 0) { echo '</ul>'; } } ); // output an "Edit" link if this page happens to be editable by the current user if($page->editable()) { echo '<li><a class="men" href="'.$page->editURL.'">Edit</a></li>'; } ?> <!-- öffne Mailformular --> <li><a class="men" href="mailto:info@malabu.de"><img src="<?php echo $config->urls->templates?>styles/brief.gif" width="25" height="15" alt="info@malabu.de" title="schreib mir"> </a></li> <!-- search form <form class='search' action='<?php //echo $pages->get('template=search')->url; ?>' method='get'> <input type='text' name='q' placeholder='Search' value='' /> <button type='submit' name='submit'>Search</button> </form> --> </ul> And this I get: <ul> <li><a class="men" href="/pw/aktuelles/">Aktuelles</a></li> <li><a class="men" href="/pw/kindheit/">Das bin ich</a></li> <li><a class="men" href="/pw/garten/">Gärten</a></li> <li><a class="men" href="/pw/meine-heimat/">meine Heimat</a></li> <li><a class="men" href="/pw/pflanzen/">Pflanzen</a></li> <li><a class="men" href="/pw/rezepte/">Rezepte</a> <ul><li><a class="men" href="/pw/rezepte/kochen/">Kochen</a></li> <li><a class="men" href="/pw/rezepte/backen/">Backen</a></li> <li><a class="men" href="/pw/rezepte/desserts/">Desserts</a></li></li> </ul><li><a class="men" href="/pw/zuhause/">Zuhause</a></li> <li><a class="men" href="/pw/impressum/">Impressum</a></li> <li><a class="men" href="/pw/processwire/page/edit/?id=1041">Edit</a></li> <!-- öffne Mailformular --> <li><a class="men" href="mailto:info@malabu.de"><img src="/pw/site/templates/styles/brief.gif" width="25" height="15" alt="info@malabu.de" title="schreib mir"> </a></li> <!-- search form <form class='search' action='' method='get'> <input type='text' name='q' placeholder='Search' value='' /> <button type='submit' name='submit'>Search</button> </form> --> </ul> Can anyone help me? Thanks in advance Günter
-
In the server's log I found the answer: PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. After setting this option to 10000 (don't know this value is choosen reasonable) everything works fine again.
-
I've build a site with some galleries (malabu.de/pw). Everything works fine, but there is one page (meine Heimat) I cannot edit like the other ones, although it uses the same template as all the other ones. I also can not find any differences in the settings. I write something in the fields belonging to the pictures (description, caption etc.), click 'save' and my text vanishes. I dont get any response or error message. I am able to write text directly into mysql (via phpMyAdmin). Could anyone help? update: After I added more Pictures I cannot add any text to the Photographs at any page, but adding more Pictures is still possible. Is there any limitation of how many Pictures a page may contain? (actually about 100/page)
-
Thanks for your help. I have now realized my gallery with a combination of url-segment (for choosing the image to enlarge) and get-procedure (for to change the order of the images). Don't know, if this ist the best way to do it, but it works for me, and I understand, what I have done. Here is the template to my site http://malabu.de/pw: <?php include('./_head.php'); // include header markup ?> <div id='index'> <?php // output 'headline' if available, otherwise 'title' echo '<h1>' . $page->get('headline|title') . '</h1>'; //get all segments and clean segments! $seg1 = $sanitizer->pageName($input->urlSegment1); $seg2 = $sanitizer->pageName($input->urlSegment2); $seg3 = $sanitizer->pageName($input->urlSegment3); //check for the second urlsegment not needed if ($seg2) { // unknown URL segment, send a 404 throw new Wire404Exception(); } //check for the third urlsegment not needed if ($seg3) { // unknown URL segment, send a 404 throw new Wire404Exception(); } // Sortierung übernehmen: $order = $input->get->order; // sortiere nach name_: if ($order >0) { $images = $page->images->sort("name_".$order); $session->set($order, $order); } // ohne Sortierung: else { $images = $page->images; } //normal content without first url segment! if (!$seg1) { // output bodycopy echo $page->body; // Links zur Sortierung: echo '<p>Sortierung nach <a class="tab" href="'.$page->url.'?order=1">'. $page->get('name_1').'</a> <a class="tab " href="'.$page->url.'?order=2">'. $page->get('name_2').'</a></p>'; // output images foreach($images as &$image) { $thumbnail = $image->height(100); echo '<div class="rahmen"><a href="'.$page->url . $image.'?order='.$session->get($order).'"><img class="shadow" src="'.$thumbnail->url.'" alt="'.$thumbnail->caption.'" title="'.$image->caption.'"></a></div>'; } } //special view output with an url segment... if ($seg1) { // get the image in the correspondent position: $index = $input->$seg1; $image = $page->images->index($index); // Link zum vorigen Bild: echo '<a href="'.$images->getPrev($images->$seg1).'?order='.$session->get($order).'"><img src="'.$config->urls->site.'templates/styles/links.gif" title="voriges Bild"></a> '; // Link zur Thumbnail-Seite: echo '<a href="'.$page->url.'?order='.$session->get($order).'"><img src="'.$config->urls->site.'templates/styles/index.gif" title="zurück zur Übersicht"></a> '; // Link zum nächsten Bild: echo '<a href="'.$images->getNext($images->$seg1).'?order='.$session->get($order).'"><img src="'.$config->urls->site.'templates/styles/rechts.gif" title="nächstes Bild"></a><br />'; // Bild zeigen: echo '<img class="shadow" src="'.$images->url . $seg1.'" alt="'.$images->$seg1->description.'" title="'.$images->$seg1->description.'">'; // Textfelder zu den Bildern anzeigen: echo '<h3>'.$images->$seg1->caption.'</h3>'; echo '<p>'. $images->$seg1->description. '<br />'.$images->$seg1->name_1.' '.$images->$seg1->name_2.'</p>'; } ?> </div><!-- end content --> <?php include('./_foot.php'); // include footer markup ?> If anyone knows to make it better, I'd like to hear about ...
-
@ justb3a: Thanks for your reply. After I have found my mistake your module works fine for me. The other wishes are luxury problems and I have a lot to learn before I try to solve it on my own. Günter
-
@ tpr: Thanks for your hint, it helped me to sort my thumbnails. But if I call a single image the order vanishes. I've tried to put the order-variable in the foreach-loop, but this did not work with the getNext and getPrev function. This is one page: http://malabu.de/pw/kindheit/ and here comes my current template file: <?php // output 'headline' if available, otherwise 'title' echo '<h1>' . $page->get('headline|title') . '</h1>'; //get all segments and clean segments! $seg1 = $sanitizer->pageName($input->urlSegment1); $seg2 = $sanitizer->pageName($input->urlSegment2); $seg3 = $sanitizer->pageName($input->urlSegment3); //check for the second urlsegment not needed if ($seg2) { // unknown URL segment, send a 404 throw new Wire404Exception(); } //check for the third urlsegment not needed if ($seg3) { // unknown URL segment, send a 404 throw new Wire404Exception(); } // Sortierung übernehmen: $order = $input->get->order; // Links zur Sortierung: echo '<p>Sortierung nach <a class="tab" href="'.$page->url.'?order=1">Name 1</a> <a class="tab " href="'.$page->url.'?order=2">Name 2</a></p>'; // sortiere nach name_1: if ($order == 1) { $images = $page->images->sort("name_1"); } // sortiere nach name_2: elseif ($order == 2) { $images = $page->images->sort("name_2"); } // ohne Sortierung: else {} $images = $page->images; //normal content without first url segment! if (!$seg1) { // output bodycopy echo $page->body; // output images foreach($images as &$image) { $thumbnail = $image->height(100); echo '<div class="rahmen"><a href="'.$page->url . $image.'"><img class="shadow" src="'.$thumbnail->url.'" alt="'.$thumbnail->caption.'" title="'.$image->caption.'"></a></div>'; // try to keep the order-variable: // echo '<div class="rahmen"><a href="'.$page->url . $image.'/?order='.$order.'"><img class="shadow" src="'.$thumbnail->url.'" alt="'.$thumbnail->caption.'" title="'.$image->caption.'"></a></div>'; } } //special view output with an url segment... if ($seg1) { // get the image in the correspondent position: $index = $input->$seg1; $image = $page->images->index($index); // Link zum vorigen Bild: echo '<a href="'.$images->getPrev($images->$seg1).'"><img src="'.$config->urls->site.'templates/styles/links.gif" title="voriges Bild"></a> '; // Link zur Thumbnail-Seite: echo '<a href="'.$page->url.'"><img src="'.$config->urls->site.'templates/styles/index.gif" title="zurück zur Übersicht"></a> '; // Link zum nächsten Bild: echo '<a href="'.$images->getNext($images->$seg1).'"><img src="'.$config->urls->site.'templates/styles/rechts.gif" title="nächstes Bild"></a><br />'; // Bild zeigen: echo '<img class="shadow" src="'.$image->url . $seg1.'" alt="'.$images->$seg1->description.'" title="'.$images->$seg1->description.'">'; // Textfelder zu den Bildern anzeigen: echo '<h3>'.$images->$seg1->caption.'</h3>'; echo '<p>'. $images->$seg1->description. '<br />' .$images->$seg1->name_1.' ' .$images->$seg1->name_2.'</p>'; } ?> Can anyone help me with the correct syntax? Günter
-
Hi, many thanks for Your fast replies! I have changed the lines 15 and 16 and the error disappears, but how do I tell PW which order I want? You may have a look at the site: http://malabu.de/pw/kindheit/ Günter
-
Hi, I'm still a newbie on PW and not very familiar with the syntax. I have set up a gallery page and now I try to give it two links to sort the images by two different fields belonging to every image. This fields I have created with the ImageExtra Module: Name_1 contains the year, Name_2 contains the place. Now I put in a link <sort by name_1> and a link <sort by name_2> This should work with urlSegment2 (urlSegment1 I use to show a specific image) <?php // output 'headline' if available, otherwise 'title' echo '<h1>' . $page->get('headline|title') . '</h1>'; // galerie.php template file // overview - and single image view //get all segments and clean segments! $seg1 = $sanitizer->pageName($input->urlSegment1); $seg2 = $sanitizer->pageName($input->urlSegment2); $seg3 = $sanitizer->pageName($input->urlSegment3); // Links zur Sortierung: echo 'Sortierung nach <a href="'.$input->post(urlSegment2 = 1).'">Name 1</a> '; echo '<a href="'.$input->post(urlSegment2 = 2).'">Name 2</a> '; //check for the second urlsegment sort order // sortiere nach name_1: if ($seg2 = 1) {$images = $page->images->sort("name_1");} // sortiere nach name_2: elseif ($seg2 = 2) {$images = $page->images->sort("name_2");} else {} //check for the third urlsegment not needed if ($seg3) { // unknown URL segment, send a 404 throw new Wire404Exception(); } //normal content without first url segment! if (!$seg1) { // output bodycopy echo $page->body; // output images foreach($images as &$image) { $thumbnail = $image->height(100); echo '<div class="rahmen"><a href="'.$page->url . $image.'"><img class="shadow" src="'.$thumbnail->url.'" alt="'.$thumbnail->caption.'" title="'.$image->caption.'"></a></div>'; } } //special view output with an url segment... if ($seg1) { // get the image in the correspondent position: $index = $input->$seg1; $image = $page->images->index($index); // Link zum vorigen Bild: echo '<a href="'.$images->getPrev($images->$seg1).'"><img src="'.$config->urls->site.'templates/styles/links.gif" title="voriges Bild"></a> '; // Link zur Thumbnail-Seite: echo '<a href="'.$page->url.'"><img src="'.$config->urls->site.'templates/styles/index.gif" title="zurück zur Übersicht"></a> '; // Link zum nächsten Bild: echo '<a href="'.$images->getNext($images->$seg1).'"><img src="'.$config->urls->site.'templates/styles/rechts.gif" title="nächstes Bild"></a><br />'; // Bild zeigen: echo '<img class="shadow" src="'.$image->url . $seg1.'" alt="'.$images->$seg1->description.'" title="'.$images->$seg1->description.'">'; // Textfelder zu den Bildern anzeigen: echo '<h3>'.$images->$seg1->caption.'</h3>'; echo '<p>'. $images->$seg1->description. '<br />' .$images->$seg1->name_1.' ' .$images->$seg1->name_2.'</p>'; } ?> I get a syntax error: unexpected '=' in line 15. Perhaps someone can help me. Thanx in advance Günter
-
Hi, I found the solution for my problem by myself: I filled out the german sections of the fields and didn't realize that guests see the default (english) version. A simple click on >Admin >Access >Users >guest >Language >deutsch brought back my vanished items. Still remains my whish to change the order of the fields and to rename them at the admin page. Thanks Günter
-
Because I myself hate topics that end up in nothing, I will show here, how I built my gallery. This template file works for me: <?php include('./_head.php'); // include header markup ?> <div id='index'> <?php // output 'headline' if available, otherwise 'title' echo '<h1>' . $page->get('headline|title') . '</h1>'; // galerie.php template file // overview - and single image view //get all segments and clean segments! $seg1 = $sanitizer->pageName($input->urlSegment1); $seg2 = $sanitizer->pageName($input->urlSegment2); $seg3 = $sanitizer->pageName($input->urlSegment3); $images = $page->images; //normal content without first url segment! if (!$seg1) { // output bodycopy echo $page->body; // output images foreach($images as &$image) { $thumbnail = $image->height(100); echo '<div class="rahmen"><a href="'.$page->url . $image.'"><img class="thumb" src="'.$thumbnail->url.'" alt="'.$thumbnail->caption.'" title="'.$image->caption.'"></a></div>'; } } //check for the second urlsegment not needed if ($seg2) { // unknown URL segment, send a 404 throw new Wire404Exception(); } //check for the third urlsegment not needed if ($seg3) { // unknown URL segment, send a 404 throw new Wire404Exception(); } //special view output with an url segment... if ($seg1) { // get the image in the correspondent position: $index = $input->$seg1; $image = $page->images->index($index); // Link zum vorigen Bild: echo '<a href="'.$images->getPrev($images->$seg1).'"><img src="'.$config->urls->site.'templates/styles/links.gif" title="voriges Bild"></a> '; // Link zur Thumbnail-Seite: echo '<a href="'.$page->url.'"><img src="'.$config->urls->site.'templates/styles/index.gif" title="zurück zur Übersicht"></a> '; // Link zum nächsten Bild: echo '<a href="'.$images->getNext($images->$seg1).'"><img src="'.$config->urls->site.'templates/styles/rechts.gif" title="nächstes Bild"></a><br />'; // Bild zeigen: echo '<img src="'.$image->url . $seg1.'" alt="'.$images->$seg1->description.'" title="'.$images->$seg1->description.'">'; // Textfelder zu den Bildern anzeigen: echo '<h3>'.$images->$seg1->caption.'</h3>'; echo '<p>'. $images->$seg1->description. '<br />' .$images->$seg1->name_1.'<br />' .$images->$seg1->name_2.'</p>'; } ?> </div><!-- end content --> <?php include('./_foot.php'); // include footer markup ?> With many thanks to mr-fan, who very patiently introduced me to the basics of ProcessWire and PHP. Günter
-
Hi, thanks for your reply. Yes, it's right: I visit the page in the frontend. If nobody is logged in I can see the image and the 'description'-field, if I log in I can see the rest of the fields. I had a look at my database with phpMyAdmin, where I can find the table 'field_images' with all the fields and it looks OK. btw. Is there a possibility to change the order of the fields of the admin page (caption before description) and/or change the label of the fields at the admin page in dependence of the page. For example: page 'Menschen': field_1 labelled 'Vorname', field_2 labelled 'Nachname' - page 'Pflanzen': field_1 labelled 'deutscher Name', field_2 labelled 'botanischer Name'. This should make it easier for users to add new pictures.
-
Hi, I have built a gallery site and use ImageExtra to add some additional informations to the images. Everything works fine if I visit the page as a logged-in user, but if I have a look at the site as a (normal) guest, none of the extra fields are displayed. I think this is a problem of missing access rights, but I did not find any point where to change it. The rights of the files on the server seem to be OK. Any ideas? Thanks Günter
-
Hi mr-fan, thanks for your reply and your advice to that very useful php-site. You are right: I prefer knowing and understanding what I am doing, not just klicking and copying around. And a text in german is much more easier to understand for me than one in english. I will try to understand your code-snippets and use it for my project. regards Günter
-
Hi, up to now I've built my (static) websites with a simple editor, so I know the most important things about HTML and CSS. But I have no experience in php or other programming languages. In ProcessWire at last I found a CMS which looks transparent to me, but it's not easy to do the first steps. With the help of Joss Sanglier's tutorial (thanks a lot) I was able to start the transcription of my first website. Now my problem: The site contains some galleries with thumbnail-pages from which a klick at one thumb shall open a new page with the image in original size, caption, additional textfields and navigation-buttons (previous and next image, back to thumbs). I try to keep this as simple as possible, without lightbox, javascript & Co. You may have a look at the original site http://malabu.de and at my trial http://malabu.de/pw Thanks Guenter