Jump to content

gtoirog

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by gtoirog

  1. Hi, I've implemented Pagination and outputting it using renderPager. And I wonder how I can make the current page link not a link, just normal text. Thanks.
  2. no worries, it was my noob skill mistake and i figured it out. thanks.
  3. I had a look in the Module if the PageArray Markup is there and it was there, a bold red link, no "Install" button next to it, so I think it must be already up and running. Not sure why nothing gets printed out when I type: $resultPages->render() / renderPager(). I'm trying to implement Pagination on my home page. Thanks.
  4. Thank you guys! Thanks, Kongondo. "include=hidden" works. Great community for newbies like me :-P Should do some more reading and use the cheatsheet more too. Processwire rocks!
  5. Under the "Home" page, I have a few hidden pages, each with a template called "category". I just want to get the list of those pages filtering with "find("template=category")" and then loop through their children. I don't get anything by doing: $cpages = $pages->find("template=category"); foreach ($cpages as $cpage){ echo $cpage->title; } And I don't get any error.
  6. and if I do <?php echo $pages; ?>, it prints only a word "Pages". I don't think I'm getting any page in this variable?! Any idea?
  7. Yeah, thanks PW is really flexible for any needs, it seems
  8. only two levels were necessary, i guess it's okay to use a repeater like i mentioned above?! foreach ($page->repeater as $repeater_item) { $plant_parts = $repeater_item->get("plant_parts"); foreach($plant_parts as $plant_part) { echo $plant_part->title; } }
  9. it was all nested pages. I got the result I want after 3 nested loops as following, but not sure if it is a right thing to do or not for hundreds of records i'll go read about how to use Repeaters properly now foreach ($page->repeater as $repeater_item) { foreach ($repeater_item as $pages_selected) { foreach ($pages_selected as $page_selected) { echo $page_selected->title; } } }
  10. Thanks guys, I will read about categorizing content properly in processwire and then have a look at what I did. I think then I can understand if i need to use Repeater or not.
  11. Home plants a a_plant1 a_plant2 b b_plant1 b_plant2 c... plant_parts part_a part_b part_c products_made_fromplants product_a product_b product_c on "a_plant1" page, I have a template with the repeater selector which contains the select box (page field type) with options "part_a, part_b, part_c" from "plant_parts" as pages, and checkbox (with values: product_a, product_b, product_c). so if i select "part_a", i can tick "product_a and product_b", if i select "part_b" then i can check "product_a, product_c" etc. on "a_plants1" page. This is the best I could organize. I just can't read the values from my select box and checkbox within the repeater field. If a repeater can contain these page fields then i should be able to read the values, shouldn't i?
  12. I don't get any output from the codes suggested and tried My website is about plants, so for each plant, I need to select values for different purposes. I have a page called Plants and under that all the plants as children. For each plant, I need to select values from a list or checkboxes. For example, for a plant called "Pine tree", i need to select "Which parts to use" as a Select input type with values "trunk, root, bark, branch"; and check values from a checkbox called "Type of product" with values like "table, chair, box etc". It's just an example. All these values are pages under their corresponding parent pages like "Parts" and "Products" under "Home". I need to repeat these fields for each part. For example, I need to select first "trunk" and then check "table, chair". In my second repeat, I will select "root" and then checkboxes "chair, box". And then next maybe "bark" for "table, box" et cetera. Does that make any sense? Am I doing it nonsense way or?
  13. Thanks for replying. All my fields in the Repeater field are Page fields with Select, Checkbox input types. So I still can not understand how I can print the title of a Page selected in my Select field inside a Repeater field and titles of checked values (Pages) in the same Repeater? It's my third day being with ProcessWire and am weak at coding, doh
  14. Hi, I have three fields: Select, Checkbox and Checkbox. I added these fields into a Repeater field and I can see the fields in Admin and I can select from the Select, tick the Checkboxes. But I don't know how to output the actual selected values. I read that the Repeater field contains my values as pages. But not sure, how to display. It seems like pages inside pages?
  15. Thank you so much, guys, for responding fast and being such great helps And I am excited to start my first project in processwire, will probably come back for more answers
  16. I was also wondering if I can search through the pages selected according to tags? I.e, If I click on a tag and get a list of posts, can I search through these posts selected within a tag? Thanks in advance. i'm liking Processwire
  17. You MadeMyDay I followed your advice though I changed some a bit. Here's what I did in details: ~ created a template called "tags" without a (php) file ~ created a template called "tag" without a (php) file * "tags" template -> family: set "Allowed template(s) for children" as "tag" * "tag" template -> family: set "Allowed template(s) for parents" as "tags" ~ created a "tags" field with Type as "Page"; Input -> "Parent of selectable page(s)" as "Tags" (page), "Input field type" -> AsmSelect; "Allow new pages to be created from field?" checked. Set "template for selectable pages" as "tag". ~ created a template called "post" and added "tags" field in addition to its default "title" and "body" fields ~ created a hidden page called "tags" with template "tags" ~ created children of "tags" page as tags with a template "tag" ~ created tags.php file and put the following code in it to render the tags list: <?php include_once("./head.inc"); $tags = $pages->get("/tags/")->children->find("sort=title"); echo "<ul>"; foreach($tags as $tag){ //iterate over each tag echo "<li><a href='{$tag->url}'>{$tag->title}</a></li>"; // and generate link to that page } echo "</ul>"; include("./foot.inc"); ?> ~ created tag.php and put the following code in it to get the list of posts related to the selected tag: $thisTag = $page->title; $tagPages = $pages->find("tags.title=$thisTag"); foreach ($tagPages as $tp){ // iterate over the pages with that tag echo " <div class='teaser'> <h3>{$tp->title}</h3> <p>{$tp->summary}</p> <a href='{$tp->url}'>Read more...</a> </div>"; } include("./foot.inc"); ?> Thank you very much again MadeMyDay and please let me know if there is anything else to improve or fix.
  18. Hi, I just discovered Processwire recently and glad that I found it. I am trying to understand how to create Tags. I know HTML and CSS basics and tiny bit of PHP. I've just read most posts about making tagging system and still confused. Maybe because of my coding skills. From what other people wrote I could understand these: *I should create one field called Tags (this Tags field will be available for posts that i create so that I can type in tag name in it/ or choose from?!?! not quite sure how it will automatically appear in my Tags folder, or maybe I should create each and every tag page under Tags manually) *I should have one template php file called tag.php for each tag page (or two template php files for both Tags parent page(tags.php) and tag children pages(tag.php)) *I should create a Tags page which is the parent for real tag pages So the order I am thinking of to do is like: - create a hidden "Tags" page (which will contain my tag names as pages) under my Home page - assign a template for this page, but not sure what kind of template it will be?!? a template with a php file or without a php file? If with a php file, then what code i shall write in?!? - create a "Tags" field with Type as "Page"; Input -> "Parent of selectable page(s)" as "Tags", "Input field type" -> AsmSelect; "Allow new pages to be created from field?" checked. But i don't know what kind of template to assign for "Template of selectable page(s)" and what code to put inside that template file if it should be a php file. - create one or two php template files. Is that correct? - create my tags under Tags - create a page just to display the list all the tags and if a click on a tag name then i will get a list of all pages with that tag Basically, i think I have no idea about what to write in the template file(s) for the tags. I really want to make a very simple list of tags just for the sake of understanding so I can go from there. Tags will be really necessary for my website. When i looked at the tag.php, tags.php in Ryan's blog, i could not understand very well. Because there were other codes mixed and calling function from blog.inc, main.inc, nav.php. And it totally made me confused as I am not good at coding. Can someone please guide me please, possibly step by step like in the tutorial "Planets" or "Basic website" in Wiki? I really want to learn and I think Processwire is fast and great.
×
×
  • Create New...