-
Posts
364 -
Joined
-
Last visited
-
Days Won
8
Everything posted by jploch
-
I forgot the "echo $out;" at the end. Now I feel a little stupid. My only excuse is that its monday morning without coffee Everything is working now! Thank you for this module and your patience with my problems!!
-
Its still not working. No images or html gets rendered from this function (rest of the page looks fine). There are no error messages (debug mode turned on), so I guess the syntax is fine. I use the image extra module with this. Could this be a problem?Anyway thanks for your help! Here is the complete code: // album list function ---------------------- function albumList(){ // Get the list of albums $albums = wire("pages")->find("parent=/work/, template=project, limit=100, sort=sort"); $out =" "; //Loop through the pages foreach($albums as $album){ // if there's no thumbnail no need to do anything if(!$album->thumbnail) continue; // save srcset tag to a variable $srcset = $album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80)); $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img $srcset alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } }
-
it holds multiple images. I tryed using first(). Now I get this: Error: Exception: Method Pageimage::first does not exist or is not callable in this context (in /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php line 409) #0 [internal function]: ProcessWire\Wire->___callUnknown('first', Array) #1 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php(347): call_user_func_array(Array, Array) #2 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___callUnknown', Array) #3 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pageimage), 'callUnknown', Array) #4 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php(371): ProcessWire\Wire->__call('callUnknown', Array) #5 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php(371): ProcessWire\Pageimage->callUnknown('first', Array) #6 /homepages/11/d86659974/htdocs/website_susannerudolf/site/temp This error message was shown because: you are logged in as a Superuser. Error has been logged. sorry my bad, it was a long day, its just an image field with a single image. And it works when I use it without the module syntax like: // album list function ---------------------- function albumList(){ // Get the list of albums $albums = wire("pages")->find("parent=/work/, template=project, limit=100, sort=sort"); $out =" "; //Loop through the pages foreach($albums as $album){ $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img src='{$album->thumbnail->url}' alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } echo $out; } but still no luck using the module syntax
-
Iam using PW 3.0.25. Maybe thats the problem?
-
I forgot to copy the out, but its there. here is the complete code: / album list function ---------------------- function albumList(){ // Get the list of albums $albums = wire("pages")->find("parent=/work/, template=project, limit=100, sort=sort"); $out =" "; //Loop through the pages foreach($albums as $album){ $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img {$album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80))} alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } echo $out; } I get the error: Error: Call to a member function srcset() on null (line 14 of /homepages/11/d86659974/htdocs/website_susannerudolf/site/templates/_func.php) Line 14 is this: $out .="<img {$album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80))}
-
Hi! This is probably a noob question (Iam a designer and frontend guy, just learned some basic php) : I have several functions in a _function.php that I include in my templates. How can I use this within a function in that file? I guess I have to redefine the variables, because they are not available there, but Iam not sure how to do this. Here is an example (not working): // album list function ---------------------- function albumList(){ // Get the list of albums $albums = wire("pages")->find("parent=/work/, template=project, limit=100, sort=sort"); $out =" "; //Loop through the pages foreach($albums as $album){ $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img {$album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80))} alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } So how is the syntax for this?: <img <?php echo $page->featured_image->srcset('featured-image', 'lazyload my-class inline-block', array('quality' => 80)); ?>> Iam using PW 3.0.25 Thanks! this module looks very promising!
-
I don't know if this is a known issue, but the orientation dropdown isn't working with the new image field from PW 3.0 and 2.8. I tried the develop branch, but had no luck. Anyway thx for this great module! Edit: I just found out, that the dropdown is working in grid view, but not in list view Edit2: none of the extra fields is working in list view
-
@adrian thanks for your quick reply! now i get a error, when I install the module (new version from github):
-
@adrian sounds great! i think that would help a lot of people that can't use ffmpeg or have no experience on how to set it up. enjoy your vacation!
-
iam looking for a way to use this without ffmpeg (not supported by my hosting environment). I won't mind to upload a thumbnail manually. are there any plans to support this? youtube or vimeo are not an option for me. thanks!
-
That worked!! Thank you so much! I Really learned something. Now I can finally use my functions in a separate file and feel more like a developer
-
THX again! that worked for me. Now I only have to figure out the part with the $sanitizer. Iam not sure how to use this and couldn‘t find an example. I want to apply the sanitizer to the array "$alltags" and save it in another array (eg. $alltagsLinks) here is an example of what I try to do (its not the right syntax) $alltags = explode("|", $page->thumbnail->tags); $alltagsLinks = $alltags->$sanitizer->pageName($value, true)
-
It still outputs an emtpy list. any ideas why the tags are not showing up? function footerProjekte(){ $alltags = explode("|", $page->thumbnail->tags); echo "<ul>"; foreach($alltags as $tag) { echo "<li><a href='{$tag}'>{$tag}</a></li>"; } echo "</ul>"; } thx!
-
@LostKobrakai thanks for your reply! Iam still quite new to php and the api. The explode function is exactly, what I was looking for. I tryed the code above, but its just outputting the "ul" and a "li" with a empty link in it. If I just print $page->thumbnail->tags it shows the tags, so they definitely exist. Another problem Iam facing is that some tags are like "corporate design" with a space in it, for the link I will need an array wich converts that to "corporate-design".
-
Hey guys, i want to put out a list with tags from an image field (thumbnail) of the page beeing viewed. The tags should link to pages, with the same name as the tags. The Tags are seperates by "|" (instead of a space). Here is my code (wich is not working): function footerProjekte(){ $alltags = $page->thumbnail->tags; echo "<ul>"; foreach($alltags as $tag) { echo "<li><a href='{$tag}'>{$tag}</a></li>"; } echo "</ul>"; } any ideas? Thx!
-
Hey guys! I just launched my new online portfolio. http://janploch.de/ This is my second site with PW and I really enjoyed working on it. Its in german, but I want to launch an english version soon (just have to figure it out). I would probably never have finished it without the help of this awesome community. Thanks for your support! Feedback appreciated. (The size of the Images are a bit heavy for mobile, I would like to improve that with "srcset" or the picture element, but Iam not sure how to do that with PW without multiple image uploads.)
- 4 replies
-
- 8
-
- portfolio
- responsive
-
(and 1 more)
Tagged with:
-
Hey guys! This is probably a total newbi question, but I cant figure it out myself. I use two links to get to the previous or next page. When the user is on the last page, I want the next link to show the first page. When the user is on the first page I want the previous link to show the last page. How can I do this with the API? This is my second site with PW, so Iam still trying to figure things out. Here is my code: <ul id="nav"> <li class="nav-left"><a href="<?php echo $page->prev->url; ?>" class="arrow"><img src="<?php echo $config->urls->templates?>img/site/arrow_left.svg"></a></li> <li class="nav-right"><a href="<?php echo $page->next->url; ?>" class="arrow"><img src="<?php echo $config->urls->templates?>img/site/arrow_right.svg"></a></li> </ul> Thx!
- 3 replies
-
- page array
- previous page
-
(and 1 more)
Tagged with:
-
Thanks kongondo for the super fast reply! That was exactly what I was looking for. Problem solved!
-
Hello! I have a problem with the order my images display on a gallery iam building for my new homepage. My gallery displays an image for every page that has the parent "work" and the field thumbnail. It works, but the images seemes to be sorted by the time the page was createted. I want the order of the images to be the order of the pages (I want to use the "move" button in pw to rearrange them). Here is my code: <?php $projects = $pages->find("parent=/work/"); foreach($projects as $project) { $out .="<a href='{$project->url}' class='item {$project->thumbnail->tags}'>"; if($project->thumbnail){ $out .="<img src='{$project->thumbnail->url}'>"; } $out .="<div class='item-info'><h1>{$project->title}</h1><p>{$project->thumbnail->description}</p></div>"; $out .="</a>"; } echo $out; ?> Thanks!
-
paypal and probably credit card payment would be great, if not allready supported. Iam an absolute beginner when it comes to PW and PHP (just build a small site with it). I tryed to intall the shop modules with a local mamp installation of PW, but I cant get it to work. If someone would have the time to build a small shop-profile with some example products, it would probably be a lot easier for me and others to build shops with PW. Anyway thanks for the quick reply!
-
If you need a complex shopping solution it is probably better to use a combination of PW and a trusted Ecommerce System like FoxyCart or Shopify. Iam currently working on a project, where the customer wants a small image/branding website with the option so sell products. They just got 3 Products with some options to choose from. Also the budget for this porject is quite small. In this case I feel like most of the existing shopping solutions are a bit of an overkill. So for this case it would be cool to have a working lightweight shop profile for the less tech savvy people here Edit: FoxyCart seems to be rather simple to implement, maybe I will give it a try.
-
Hi Luis, thx for your effort to the development of a lightweight shoping solution! Iam from germany too, and need something like this for a project Iam working on. I tryed your template with the module apeisa created. Is there a chance, we are getting a shop profile, with some basic shop functionality and example products in it? Would be super awesome, as Iam struggling to get it to work with just the template files
-
fixed
-
Hi Nico, danke für deine Antwort. Die deutsche PW Seite habe ich schon gesehen, gute Arbeit! Für einen Entwickler hast du ein sehr gutes grafisches Auge finde ich, und das mit 17 Ich werde in den nächsten Wochen meine erste kleine PW seite launchen und dabei hoffentlich ne menge lernen. Vielleicht können wir in der Zukunft ja mal ein Projekt zusammen machen. Beste Grüße Jan ----- Translation: Hi Nico, thx for your answer. I have seen the german PW site, good work! For a developer you have a very good understanding of design and that with just 17 years. In the next weeks I will launch my first PW site and hope to learn more. Maybe we can work together sometimes. Best Regards Jan