Jump to content

Franko

Members
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

2 Neutral

About Franko

  • Rank
    Jr. Member

Profile Information

  • Gender
    Male
  • Location
    St. Petersburg Florida
  1. oops I didn't mean to have that commented out. Its not in my code, but that was a copy that I forgot to uncomment. I am not seeing empty <h3> tags or <p> tags and yes the product description is coming from the hanna code. In fact the only thing that showing on the page is the product description from the hanna code. Everything else disappears including all paragraphs and everything else in the textarea $page->body. There is nothing weird in the source. It has to be the way this php is whitten I think because I am using other php for another hanna code and it works. this is the other code that works <?php foreach ($page->children() as $c): ?> <li><a href="<?=$c->url;?>"><img src="<?=$c->listImage->url;?>" alt="<?=$c->listImage->description;?>" width="100" height="100"> <?=$c->listImage->description;?> <span>View More</span></a></li> <? endforeach; ?>
  2. For some reason I cannot get hanna code to work with php. I can get html to work just pine but php will not. Here is my code <?php foreach($page->children as $product) { if($product->image) { // $image = $product->image->width(150); $img = "<img src='{$image->url}' alt='{$product->title}' class='flt-left-img' />"; } else { $img = "<span class='image_placeholder'>Image not available</span>"; } echo " $img <h3>{$product->title}</h3> <p>{$product->product_description}</p> <hr /> "; } ?> The only thing that will output on the page is the product description but all other content from the body disappears. Driving me nuts so any help would be great.
  3. It was just the setting for the image. Thank you. It's works when I add this code to the template file but will not work if I use Hanna Code. I cannot get hanna code to output php from body content. I do have it set in body setting but still wont work.
  4. I'm just trying to call 3 fields from a child page and list them on the parent page for a products list. Here is the code. I can get the title and product description to pull but not the image. I also would like set the hight and width but every time I uncomment that it creates an error. foreach($page->children as $product) { if($product->image) { // $image = $product->image->width(150); $img = "<img src='{$image->url}' alt='{$product->title}' class='flt-left-img' />"; } else { $img = "<span class='image_placeholder'>Image not available</span>"; } echo " $img <h3>{$product->title}</h3> <p>{$product->product_description}</p> <hr /> "; } ?> Advise would be appreciated.
  5. foreach($page->children() as $c){ This worked exactly as I was trying to do it. Thank you very much adrian!
  6. Oh I see what you did and that works by returning list image from home page but I would to return listimage from child pages as in Page A as Parent. So in other words I want Page A to display listimage from its child pages and I want page B to display listimage only from it's child pages.
  7. Home Page A Child Page Child Page Page B Child Page Child Page All Child pages have the same template. I want to return listimage field from child pages but only to their parents.
  8. Here is my current code <?php foreach($pages->find('template=basic-page') as $c): ?> <li><a href="<?=$c->url;?>"><img src="<?=$c->listImage->url;?>" alt="<?=$c->listImage->description;?>" width="100" height="100"> <?=$c->listImage->description;?> <span>View More</span></a></li> <? endforeach; ?> What I don't know how to do is return content from the template basic-page but only from child pages. I'm thinking maybe I can just return the fields from the children pages without calling the template but I do not know how. Suggestions would be appreciated.
  9. Yes I am new to php. Ok so I am now assuming that I need to write the php in the top section of the page and echo the content with the tag on the page. I then need to write the css based on the output of your code that comes out when it is echo on the page. Correct? Here is my code which is different from what outputs. Some elements like the <article> are repeating. <section id="content" class="cols-a"> <div class="news-a"> <article> <header> <p>Thursday, April 3, 2014</p> <h2><a href="./">Safety Tips for the Garage</a></h2> </header> <figure><img src="http://placehold.it/660x160" alt="Placeholder" width="660" height="160"></figure> <p>You have taken special care to be sure that your home is safe. If you have small children, you’ve childproofed the electrical outlets. If you have older children, you’ve discussed Internet safety and might have installed a filter to block objectionable material. You likely have used baby gates, screened babysitters, and are careful when you use a ladder. Undoubtedly, safety is important. Many times, however, safety issues in the garage are unintentionally overlooked, because the area is not seen as an actual room that your family lives in. Here is a list of things to double check to be sure that your garage is as safe as possible...</p> <p class="link-b"><a href="./">Read more</a></p> </article> </div> </section> The article section needs to repeat for each post like in the image. This is whats outputting This is the code I am using in the page. //main content $limit = $page->blog_quantity;//number of posts to show on Blog Home Page (pagination kicks in if more posts than limit) $content = ''; $content .= $blogOut->renderPosts("limit={$limit}"); So I am not sure how to get it to output that I want. My lack of php skills is most likely the problem but I have come to love Processwire over Wordpress and Modx. Any help would be appreciated.
  10. Ok, so maybe you can point me in the right direction. How do I output my code? I edited the template files with my html and added the php calls you had in your template files. That seems to work, but there is a bunch of code outputting that is not mine and messing things up. I'm assuming that I need to edit the MarkupBlog.module file? The only thing is I can't figure out what needs to be changed in that file to output my html. I'm also assuming that I change the things where there is code listed after all the $out .= but there seems to be a lot of code that that I do not need. Please advise.
  11. I have built a few websites on Processwire now but for some reason cannot rap my head around implementing this blog into my current design. I don't understand why you have so many template files and how to edit or get things to output in my html/css coded pages. I would like to just be able to plug the right calls into my current design. Please advise. Complete stuck trying to implement this into my current design.
  12. Soma, Is it possible to use the checkbox method but only show checked ones?
  13. Sun of a Gun, It worked! Thank you diogo.
  14. I am new to processwire and php. This is basically a list page that I want to be able to display an image and description from a child page on and then link to that child page. What is the code to link to the child page? I'm sure this is very basic, but cant figure it out. Help would be appreciated. <? foreach($page->children as $c): ?> <li><img src="<?=$c->listImage->url;?> " alt="<?=$c->listImage->description;?>" width="167" height="167"> <?=$c->listImage->description;?> <a href="LINK TO CHILD PAGE">View more</a></li> <? endforeach; ?>
×
×
  • Create New...