Jump to content

jploch

Moderators
  • Posts

    437
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by jploch

  1. 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
  2. Iam using PW 3.0.25. Maybe thats the problem?
  3. 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))}
  4. 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!
  5. 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
  6. @adrian thanks for your quick reply! now i get a error, when I install the module (new version from github):
  7. @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!
  8. 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!
  9. 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
  10. 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)
  11. 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!
  12. @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".
  13. 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!
  14. 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.)
  15. 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!
  16. I tried to get it to work with an image field, instead of the textfield, somas post didn't work for me. Could someone help me out or are there any news on the module to support image fields?
  17. Thanks kongondo for the super fast reply! That was exactly what I was looking for. Problem solved!
  18. 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!
  19. 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!
  20. 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.
  21. 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
  22. 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
  23. @pwired I may have exaggerated a little, due to me being very exited about PW as I learn more about it I dont have that much experience with the mentioned CMS solutions. From what I read and tryed, I felt like Textpattern and CouchCMS seemed to lack a little flexibility. For me the main problem with wolf cms was my lack of PHP knowledge. GetSimple seems to be really cool, but I like the content organization from PW more. That said I do think all of them are great CMS solutions.
  24. @vineonardo thx Man! interesting read. In my search for a cms to fit my needs I also considered Textpattern and other smaller cms solutions like GetSimple, Wolf CMS or CouchCMS. All those seemed to be great when it comes to smaller websites but lack flexibility and functions for bigger projects. Iam glad that I finally found the best solution (PW). The community seems to be really great too, nice to be part of it now
×
×
  • Create New...