-
Posts
253 -
Joined
-
Last visited
-
Days Won
2
Everything posted by nikola
-
This is my first site made with Processwire. Ryan and others pointed me to the right direction when I needed help, so thank you guys! You can view the site at: http://www.promoteka.hr What needs to be done (haven't been finished): English version of the website Some minor cosmetic changes Hope you like it.
-
Thanks Ryan! Will let you know how it works.
-
It would be nice to have integrated file manager where we could quickly browse images and other media. For instance, if we have images field in admin, currently we have only option to browse for images from local disk. It would be nice to have another button next to browse button that would call file manager and allow us to select images (or files) located already on the server. I used elFinder file manager found at http://elrte.org/elfinder before and I think it would be nice if we can see that option integrated in the future. This is a different approach from what we currently have in choosing image insertation through TinyMCE...
-
Hi Ryan, is it possible for you that you create a new inputfield as you suggested in end of your post (so we can skip encode/decode)? I think it might be useful to others also. Thanks!
-
Thanks Ryan, I'll try it tomorrow and let you know how it works...
-
Thanks, I'll try to inspect the code, maybe I'll come up with something.
-
I want to extend image field to have second text input besides description so I can easily add link alongside the description. What needs to be done to accomplish that feature? It's a neat feature for image sliders, carousels etc.
-
Thanks Ryan, will try it out.
-
The problem was in my PHP settings, I've tried the same code that I've used in my previous contact forms on my pc at work and it worked. But this type of form uses PHP mail function embedded directly in template, rather then using external PHP file for processing the form in the "action" parameter. I'll try other options in next few days, but currently I have working forms on my project web site. P.S. The web site I've been working on will be public in a day or so and I'll post it into the showcase section.
-
No problem. Thanks for your help, Ryan.
-
Thanks, I've manage to solve it and ended up using this combination: <?php echo "<div class='photo-gallery'>"; $photos = $pages->get('/foto/'); $limit = 16; $start = ($input->pageNum-1) * $limit; $images = $page->images->slice($start, $limit); $total = count($photos->images); $a = new PageArray(); foreach($images as $unused) $a->add(new Page()); $a->setTotal($total); $a->setLimit($limit); $a->setStart($start); foreach($images as $image) { $thumb = $image->size(142, 92); echo "<a rel='colorbox' href='$image->url'><img src='{$thumb->url}' alt='{$thumb->description}' width='{$thumb->width}' height='{$thumb->height}' class='photo' /></a>"; } echo "</div>"; echo "<div class='clear'></div>"; $start = $a->getStart(); $end = $start + count($a); $total = $a->getTotal(); $num = $input->pageNum; $lastNum = ceil($total / $a->getLimit()); echo "<p class='numbering'>Prikazano fotografija: $start - $end od $total | stranica $num od $lastNum</p>"; echo $a->renderPager(array( 'nextItemLabel' => "Sljedeća", 'previousItemLabel' => "Prethodna", ));
-
Hmm, It doesn't work as intended, Images are repeating themselves. I tried different approach: I have Gallery page in the root of the website, and Gallery page has children. I didn't put the limit on number of images that can appear on any of the children. I use this code to grab all image from all the children pages. I need to paginate them with the limit of 16 per page. <?php echo "<div class='photo-gallery'>"; $photos = $pages->get('/foto/'); foreach($photos->children as $photo) { foreach($photo->images as $p) { $t = $p->size(142, 92); echo "<a rel='colorbox' href='$p->url'><img src='{$t->url}' alt='{$t->description}' width='{$t->width}' height='{$t->height}' class='photo' /></a>"; } } echo "</div>"; If I use <?php foreach($photo->images->find("limit=16") as $p) { the limit count doesn't work right... and pagination doesn't work either. Template has numbering turned on.
-
Ok, no problem. Thanks
-
Ryan, are you willing to post the complete code of one of your contact forms so I can take look into it? Thanks in advance.
-
I have a contact form that uses external php file for validation and sending mail. If I use it as a standalone it works in a normal way, but when I import it into Proccesswire form action input 403 forbidden page. External php file is declared in form action (sendemail.php) <form id="form" name="form" method="post" action="sendemail.php"> It also occurs if I specify direct path to sendemail.php using: <!--?php echo $config--->urls->templates?>sendemail.php sendemail.php file includes phpmailer.class.php which is also located in templates folder.</form>
-
It works! Thanks Ryan for your help (others included )
-
I still haven't figured this out yet. When using Ryan's code I get following errors: Exception: Method Pageimages::renderPager does not exist or is not callable in this context (in C:\inetpub\wwwroot\pw\wire\core\Wire.php line 231) #0 C:\inetpub\wwwroot\pw\site\templates\gallery.php(46): Wire->__call('renderPager', Array) #1 C:\inetpub\wwwroot\pw\site\templates\gallery.php(46): Pageimages->renderPager() #2 C:\inetpub\wwwroot\pw\wire\core\TemplateFile.php(88): require('C:\inetpub\wwwr...') #3 [internal function]: TemplateFile->___render() #4 C:\inetpub\wwwroot\pw\wire\core\Wire.php(267): call_user_func_array(Array, Array) #5 C:\inetpub\wwwroot\pw\wire\core\Wire.php(229): Wire->runHooks('render', Array) #6 C:\inetpub\wwwroot\pw\wire\modules\PageRender.module(194): Wire->__call('render', Array) #7 C:\inetpub\wwwroot\pw\wire\modules\PageRender.module(194): TemplateFile->render() #8 [internal function]: PageRender->___renderPage(Object(HookEvent)) #9 C:\inetpub\wwwroot\pw\wire\core\Wire.php(267): call_user_func_array(Array, Array) #10 C:\inetpub\wwwroot\pw\wire\core\Wire.php(229): Wire->runHooks( If I use seddass's method I can't paginate either. I tried the solution with one page that holds images and with children pages that contain images and still no go. I'm attaching the screenshot how should it look like...
-
It appears in Croatian, Bosnian and Serbian languages. It is safe to convert it to "dj" because it's normal to substitute it in this way in these languages.
-
I've noticed that when using character "đ" (Croatian) in title name it doesn't convert to appropriate character in slug, rather it disappears. The solution is to add matching substitute in wire/modules/Inputfield/InputfieldPageTitle/InputfieldPageTitle.js. var str1 would contain character "đ" and matching substitute in var str2 would be "d". More correct way would be that it is replaced by characters "dj", but variables are made to replace only single characters. Other Croatian characters that are found also in other languages are substituting fine, because they already exist in variable str1.
-
I was unable to get images with pagination based on Ryan's method. I've decided to tako another route and follow Ryan's advice to make children pages underneath "Gallery" page that will contain 20 images per page. I use this code to merge them together, but yet again can't use pagination. <?php foreach($page->children() as $gallery) { if(!count($gallery->images)) continue; foreach($gallery->images as $image) { $thumb = $image->size(142, 92); echo "<a href='{$image->url}' rel='colorbox'><img src='{$thumb->url}' width='{$thumb->width}' height='{$thumb->height}' class='photo' /></a>"; } } ?> Probably it isn't the smartest way to do it but it gets the job done ... all I need is now to paginate them so I can have 20 images per page...
-
Thanks for you help, waiting for the code...
-
Unfortunately it doesn't work. I've tried various combinations and can't make it work... Ryan, any tips about the way it can be done?
-
Yes, I have. I know how to return an array of pages and paginate them, but I need similar but different approach. I have only one page that contains images for gallery, it doesn't have parent page nor it spans across children pages with images. The page will contain lots of images and I want to set pagination to have 20 images per page but I don't know how to make pager limitation based on one page.
-
I've set up a gallery page that uses "gallery" template. The gallery page will contain lots of images but I want to display only 20 per page. How can I accomplish pagination for this type of action? I don't want to set up children pages that will contain 20 images per page, rather let the Processwire do the pagination from one page. Thanks
-
I've made a three level menu using this code, it's simple but it works. It highlights every selected level. Change the variables to fit your own or use mine, whatever suits you. <?php echo "<ul>"; $rootPage = wire('pages')->get('/'); foreach($rootPage->children as $menu) { $rootclass = $menu === $page->rootParent ? " class='current'" : ''; echo "<li$rootclass><a href='{$menu->url}'>{$menu->title}</a>"; if($menu->numChildren > 0) { echo "<ul>"; foreach($menu->children as $child) { $class = $child === $page ? " class='current'" : ''; echo "<li$class><a href='{$child->url}'>{$child->title}</a>"; if($child->numChildren > 0) { echo "<ul>"; foreach($child->children as $grandchild) { $subclass = $grandchild === $page ? " class='current'" : ''; echo "<li$subclass><a href='{$grandchild->url}'>{$grandchild->title}</a></li>"; } echo "</ul>"; } echo "</li>"; } echo "</ul>"; } echo "</li>"; } echo "</ul>"; ?>