Jump to content

doolin

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by doolin

  1. HI Guys I need help. I try to convert a design-template in processwire. What is the best way to achiev this layout. It aa simple "directory" site that includes allways the same date per Item. 3 text field and a couple of images. My first try was to solve this by using repeaters and accordeon. Every Item are a Tab. But i get errors because i try to use multiple galleries for the Images inside the Items -> galleria, ninja slider. So i need a better solution. I do not need the Accorion. Maybe Sites instead Repeaters? I wantet to use repeaters because i think the repeaters are very easy for the client, thats the most important!
  2. Hi guys I've created a simple overview template named "basic-page" to display the text, image and comment field of each page who has template "standard" / Home site -> Overview template "basic-page" -> Gets all Fields from the existing pages through a loop via $pages->find("template=standart"); i also add the comment module for each item in the loop, to view and write a comment. Its like a dashboard, you see all of the content of each page, on the home site. Now i noticed, when i add a comment to a page on the home page, the comment is added in each of the page, not just on this site i have commented. On a page itself, for instance /mypost/ it works, the comment just adds to this page. Can anyone tell me, what im doing wrong. thanks..!! Here ist my basic-page template: <?php include("head.php"); ?> <?php $dir = $config->urls->admin; if($user->isLoggedin()) { ?> <form action="<?php echo $dir ?>add/" method="post"> <button type="submit">Beitrag Hinzufügen</button> </form> <?php } $seiten = $pages->find("template=standart"); foreach($seiten as $s) { echo '<div id="block">'; echo "<h1><a href='{$s->url}'>{$s->title}</a></h1>"; $n = $s->name; if($user->isLoggedin()) { ?> <div id="funk"> <form action="<?php echo $dir ?>realy/" method="post"> <input type="hidden" name="seite" value="<?php echo $n ?>"> <button type="submit">Löschen</button></form> <form action="<?php echo $dir ?>edit/" method="post"> <input type="hidden" name="seite" value="<?php echo $n ?>"> <button type="submit">Ändern</button></form> </div> <?php } echo '<div id="bilder">'; foreach($s->bilder as $image) { $thumb = $image->width(200); echo "<a href='$image->url' class='fancybox' rel='gallery1'><img src='$thumb->url'></a>"; } echo '</div>'; ?> <?php echo '<div id="text">'; echo "<p>{$s->body}</p>"; echo '<div class="flip"><h1>Kommentare ↓</h1></div>'; echo '<div class="kommentare">'; echo $s->kommentar->render(); echo $s->kommentar->renderForm(); echo '</div>'; echo '</div>'; echo '</div>'; } ?> <?php include("foot.php"); ?>
  3. Haha yeah...really...We could speak Swiss-german...nice weekend!
  4. this is embarrassing, because i checked the code for errors but i cant see this! My "Syntax View" is not so good right now, but it gets better. Now, I've removed the "!" from: if (!$this->user->name === 'selina') and now, processwire takes the selected css file! It does what it should do Very nice, thank you
  5. Ok, the CustomLogout Module works fine now I try to understand. The problem was, you have to define a separate function and call it. Before we try it with an event right? why that didn't work? For the SiteHider i still get this error: I'm not even can install the module, I get the error as soon i transfer the files in the /modules folder
  6. No. There are already an "Login" page under /admin that i never created. My created site is here /login. I tried to move the /admin/Login site to / and get an error. CustomLogout.module <?php class CustomLogout extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Custom Logout', 'summary' => 'Redirects to a custom login page after logout', 'singular' => true, 'autoload' => true ); } public function init() { $this->addHookAfter('Session::logout', function($event) { $this->session->redirect($this->pages->get('/login/')->url); }); } } SiteHider.module <?php class SiteHider extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'SiteHider', 'summary' => 'Hide Sites in CSS per User Roles', 'singular' => true, 'autoload' => true ); } public function init() { $this->addHookBefore("ProcessPageList::execute", function($event) { if (!$this->user->name === 'selina'); $this->config-styles->add($this->config->urls->templates . "css/sitehide.css") }) } } I use PHP Version 5.3.29
  7. It's a module: /** * ProcessWire Login Process * * Provides Login capability for ProcessWire Admin * * For more details about how Process modules work, please see: * /wire/core/Process.php * * ProcessWire 2.x * Copyright (C) 2014 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class ProcessLogin extends Process { protected $nameField; protected $passField; protected $submitField; protected $form; protected $id; public static function getModuleInfo() { return array( 'title' => 'Login', 'summary' => 'Login to ProcessWire', 'version' => 101, 'permanent' => true, 'permission' => 'page-view', ); } ............. the error Log:
  8. ESRCH, thank you very much for your effort and the great explanation! No, Now i understood how hooks are working and for what they are. Yes, CSS, thank you. I dont know why i did not think about this. Good solution. Ok, i created an module according to your instructions. The module are installed now. If I Logout now, it redirects me to /admin/login/logout and i get a There are already an site called "Login" by default from processwire. So i create a new site in "/" called "logins", and customize your code. But i still get the error? I created a new module for the css hook: <?php class SiteHider extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'SiteHider', 'summary' => 'Hide Sites in CSS per User Roles', 'singular' => true, 'autoload' => true ); } public function init() { $this->addHookBefore("ProcessPageList::execute", function($event) { if (!$this->user->isSelina()) $this->config-styles->add($this->config->urls->templates . "css/sitehide.css"); }) } } And get this error: I also get the same error if i combine both hooks like you sayed What im doing wrong? I have to say i've added in the first line of both modules "<?php".
  9. Hi ESRCH Thanks for the right code. Yes i user the link in the admin area. Where i have to put this code? I read in the Docs i can place hooks anywhere i want with the autoload method. I add the code into the default.php in the Default admin theme, but it doesn't work? yes i see, i can set the site as non editable, but the site are still display, but i have to hide it. Is there no easy way? greats
  10. Hi guys I try to create a custom login page. So i read a lot in the forum about this, but i don't understand how i have to implement it. The login page was no problem, i use the code from ryan here: https://processwire.com/talk/topic/107-custom-login/?hl=%2Blogin+%2Bcustom And customize my login page. At the moment is this site my default admin page: /admin. So my first idea was..I create a new site called "login" and add my custom Login site as template to this site. This worked fine, but now i have two more problems: First, when the user logout via the custom logout links, he gets back to the old default login site "/admin". I've tried to change this in the admin template, without success. I use the Default admin theme. Second: The created page "login" is visible in the site tree, but it should be hidden for non admin user, so i move the "login" site below the admin site, but now the non admin user cannot access the site anymore. I also tied to customize the template access, but the site are still visible. Can anyone explaine me a better solution for this? Greats
  11. ok. Better later than never ;-) I've used an repeater field, so the customer are available to add new items by himself. I solve this problem like this. I created an repeater called "refrep" and add Two fields: 1 x img field called "img" and.. 1 x url field with the name "linkurl". so the repeater field "refrep" looks like: refrep -->img -->linkurl I add the "refrep" field into a template, and add this code: <?php foreach($page->refrep as $ref) { $image = $ref->img; $thumbnail = $image->size(120); echo "<li><a href='$ref->linkurl'><div class='frame2'><span class='helper2'></span><img class='sigalthumb2' src='$thumbnail->url' title='$thumbnail->description' alt='$thumbnail->description' ></a></li>"; } ?> Thank you
  12. im sorry kongondo....ok i restart, forget the names of the fields above Here my template, a simple code that displays all of my images on this site. I use the ImageExtra Module for this: <?php foreach($page->referenzen as $image) { $thumbnail = $image->size(120); echo "<li><a href='http://{$image->Webseite}'><div class='frame'><span class='helper'></span> <img class='sigalthumb' src='{$thumbnail->url}' alt='{$thumbnail->description}' ></a></div></li>";} ?> "referenzen" = ImageExtra Field "Webseite" = a custom created field od ImageExtra in the field "Webseite" i can now enter the URL, if i add the "http://" in the template. I try your solution with an URL Field but, without succes.
  13. ok. But i want it to add in a loop. I think in this case its only possible this way? foreach($page->bildermitlink as $image) { $thumbnail = $image->size(150,100); echo "<p><a href='http://{$image->www}'><img src='{$thumbnail->url}' alt='{$thumbnail->description}' ></a></p>";} ?>
  14. i've created a field with the name "uurl". The type are "URL" when i add: <?php echo "<a href='$image->uurl'>Click Here for the WEBSITE</a>";?> i get the same link like before: http://localhost/wire/cdsacdsac/www.google.com and when i try this: <?php echo "<a href='$image->www->uurl'>Click Here for the WEBSITE</a>";?> contains the link of the current site
  15. Thank you very much! When i add th "http://" before, it works...the proposal of kongondo doesn't!? i add a new field in processwire choose "url" as type, and called it "curl". My template looks like this. <?php echo "<a href='$image->uurl'>Click Here for the WEBSITE</a>";?> try this too <?php echo "<a href='$image->www->uurl'>Click Here for the WEBSITE</a>";?> and it dont work . I add this in the Module options too, nothing happens.
  16. Hi kongondo Thanks. I tried and add a new text field where i can type the url called "www". Ive customized the template, and called the field: <?php echo "<a href='$image->www'>Click Here for the WEBSITE</a>";?> When i click on this link it redirect me to this adress: http://localhost/wire/bildextra/www.google.com is this because i use a local xampp environment?
  17. hi adrian i had a look at the image extra field. It allows just internal site links not external, so thats no option. Child pages are also no option. Yes i am a newbie, and it's sometimes hard to understand. The PageTable field don't make sense at the moment for me. I read a lot about it in the forum here...but i'm not figured out how to use it. My programmer skills are unfortunately not so very well. how should i proceed with PageTable? Is there not a simple php solution to use a custom link? Thanks
  18. Hi guys How is it possible to add a external link for each images? First i try to use the image description field as an url. but it doesn't work, redirect problem. Second try create a field called "website-link", and add it to the template, so the customer is able to type the website url by himself but i can't add it in the backend to each one of the pictures? How can i fix this. my template: <?php foreach($page->referenzen as $image) { $thumbnail = $image->size(120); $weblink = $thumbnail->description; echo "<li><a href='$weblink'><div class='frame'><span class='helper'></span> <img class='sigalthumb' src='{$thumbnail->url}' alt='{$thumbnail->description}' ></a></div></li>";} ?>
  19. Worked for me too! Really great! thank you!
  20. hi DaveP Thank you! I've tried the Code, but it doesnt work . It just displays all images, thumbnails and the full size when i click on one, nothing happens. It adds just a "#" after the "/" in the address bar. No error logs in the console.
  21. hi guys I wanna add a simple html image gallery from here: http://basicuse.net/articles/pl/textile/html_css/how_to_create_a_simple_css_gallery_without_using_javascript i try this in the in my template file: <?php foreach($page->bild as $image) { $thumbnail = $image->size(150,100); echo "<li><a href='#{$thumbnail->description}'><img src='{$thumbnail->url}' alt='{$thumbnail->description}' ></a></li>"; } echo "</ul><div id='full-picture'>"; echo "<div><a name='{$thumbnail->description}'><img src='{$image->url}' alt='{$thumbnail->description}' ></a></div>"; ?> </div> </div> but it dont show the image when i click on a thumbnail. I think i have to add something into the loop. But what? can anyone give me a tipp? thank you
×
×
  • Create New...