Jump to content

mel47

Members
  • Posts

    330
  • Joined

  • Last visited

Everything posted by mel47

  1. Hi, I progress! I created the fields. It seems to have to have a little inconsistency between "glossar" and "glossary" but I thinks everything is fine now. But it doesn't seems to works. If I understand correctly, if the term is not created, it should at least remove the ||. But even if the glossary_item "test" exists, nothing seems to happen. Do you have an idea of what going wrong? Thanks PS Evidently, module is correctly installed, there is no error. I'm using PW 3.0.28
  2. Hi @mr-fan Your module sounds to be exactly what I'm looking for . Unfortunately, I'm not sure I understand what to do. I tried to import your example template but ran many errors (see screenshot). I'm using PW 3.0.24. Do I can just create a "page_link" field in the glossary_term template (since I will just use this one)? Do I need something else particular? Can I add another field like summary to have a more longer text? Also, if want to output the list of all terms on the glossary page, I just used the template/field as we normally do? Thanks Mel
  3. Hi Thanks so much! Little details, big changes! I add my final result, successful, in case some future beginners needed and also if someone have suggestion to optimization (like why I'm unable to use the function I wrote in member instead of re-type markup on team page...). Mel Team (team template) ----Categ1 (categ_team) ------Member 1(member) ----Categ2 (categ_team) -------Year (categ_team) -----------Member 2 (member) -------Year (categ_team) -----------Member 3(member) $categ_team = $page->children("template=categ_team"); foreach ($categ_team as $categ) { $content .= "<h2><a href='{$categ->url}'>{$categ->title}</a></h2>"; $categ_team_year = $categ->children("template=categ_team"); $past = $categ->children("template=member, actual=0"); if(count($past)) { foreach($past as $member) { $content .= "<h4>{$member->title}</h4>"; } } if(count($categ_team_year)){ foreach ($categ_team_year as $year) { $content .= "<h3><a href='{$year->url}'>{$year->title}</a></h3>"; $past = $year->children("template=member, actual=0"); if(count($past)) { foreach($past as $member) { $content .= "<h4>{$member->title}</h4>"; } } } } }
  4. Hi Thanks for your answer. I had already tried It doesn't work since it recopy the full page (with header etc..) as you suspected. Yes, I want individual pages (and they are displayed ok). And I also want to use it in others pages, team and maybe eventually an other one. I'm ok to write markup directly in team's template, it's easier and too bad for reduction of amount of code for now. Will try this later. But now, I messed up my loops and can't displayed what I want. I don't know how to display only $past under is own category (which could be either 1 or 2 levels). $categ_team = $page->find("template=categ_team, parent=/team"); $categ_team_year = $pages->find("template=categ_team, parent=$categ_team"); $past = $page->find("template=member, actual=0"); foreach ($categ_team as $categ) { //1st category $content .= "<h2><a href='{$categ->url}'>{$categ->title}</a></h2>"; if($categ_team_year){ foreach ($categ_team_year as $year) { //2nd category (not always present) $content .= "<h2><a href='{$year->url}'>{$year->title}</a></h2>"; //Problem: Print under every categ } foreach ($past as $member){ //I want only $past and not all but it should have a categ_team_year->children somewhere? $content .= "<h4>{$member->title}</h4>"; // } What I'm doing wrong? Thanks Mel
  5. Hi, I'm fighting to display all photos on the same page (team)... I use a 3 levels : Team --categ_team ---member team's template: $content = $page->body; $categ_team = $page->find("template=categ_team"); foreach ($categ_team as $categ) { $content .= "<h2>{$categ->title}</h2>" foreach ($categ->Children() as $member){ $content .= $page->render("member"); //Why this doesn't work? } } member's template: $content .= "<p>{$page->summary}</p> <p>{$page->project}</p> <p><a href='{$page->one_image->url}'><img src='{$page->one_image->url}' alt='{$page->one_image->description}' ></a></p>"; Why I'm not able to render the member's template in the team's template? I tried many variations but without success... Thanks Mel
  6. Thanks for answers. So I understand, from both of you, I should have a specific template and not an universal basic-page one. It's fine. However I'm still unable to display all categories and all links on the page. $links = $pages->find("template=links"); foreach($links as $l) { $content .= "<li><a href='{$l->url}'>{$l->title}</a></li>"; //fine for displaying categories but missing the repeater. // echo $l->render(); doesn't work, copy all the page (including header, etc..) } So how I get all children but also their own children ? How I could refer to the repeater (which have already his template) ? It's probably something about the each() @blynx mentions. However I have no idea what to do with it and couldn't find any examples in the forum. Sorry for my ignorance. Mel
  7. Hi I read tons of posts/tutorials about categories and variations on the same subject. However, I think there is something I don't understand or just use a wrong design. Does someone could kindly explain where is my problem? Directory (basic-page template) -- Category (links template) --- Link 1 (repeater) I have no problem to output the content of the repeater on his own page of category. However, my problem is to list everything on the directory page. I suppose I can do a $page->find("template=links") but it make no sense to add that on a general basic-page template. Or do I should have a specific template for the parent page? Or some kind of function I can reuse? (I have the exact same problem for my gallery page with a category and their children) Thanks. Mel Links template $content .= $page->render('links'); /Fields/links function renderLinks($page) { foreach($page->links as $link) { echo "<h2><a href='{$link->http_link}'>{$link->title}</a></h2>"; echo "<p>{$link->summary}</p>"; echo "<p><a href='{$link->one_image->url}'><img src='{$link->one_image->url}' alt='{$link->one_image->description}' ></a></p>"; } } $content = renderLinks($page);
  8. Hi Still on my quest to build my website. Since now I know how to basically display fields, I'm now at a design' step. I know I can do, what, and how, I want using PW, but there is so many possibilities! Could you help to choose the more efficient technique and/or point me pro and cons of each of them? My page is a classic team page Team Some text Director 1 (photo+text) Director 2 (photo+text) Other members ~35 photos separated in differents categories (photo, name and position title) Some text Method 1 : a page for each section. Pictures uploaded in one field, as described here. Using photo tags to create the different sections and description for name and position. Method 2: each person is a page. A field "category" will be added to displayed them correctly. Method 3 : repeater but I'm not sure yet how it works and his advantage or inconvenient. I have 35 photos to upload for now (one time upload, after I will add/modify only 2-3 by year). I was thinking using a module to batch Import via CSV to create pages (which seems to speed up with method 2) (However, I don't know if it's working for images). On the other hand, method 1 is also easy for uploading pictures in 1 click. However, adding description in batch seems more complicated and less easy to maintain (more clicks to see them). Also, subsidary question. If I want to re-use some pictures in an other webpage, is it easier to reuse from this page or just reupload and recreate a child page in an other page? Do I miss something? Thanks Melanie
  9. Oh wow, thanks so much. I put in practice those new knowledge! (but probably come back later with more complicated stuff... ;-)
  10. Hi, So, first question... To learn how to use PW, I tried to build a really basic news system. So I created a news template with 4 fields - title, date, summary, image. Done. After, as I was not sure I started from basic-page.php and tried to modify by using HTML from my old website. After many trials and errors, I succeed to display something. <?php namespace ProcessWire; $content = "<article><h2>" . $page->body . "</h2> <header class='news-meta'> <strong>Date : </strong> " . $page->get("publish_date") . " </header> <div class='news-content-text'> <p>". $page->get("summary") . "</p> </div> <div class='article'> text </div> " . "<p><img src='" . $image->url."' alt='". $image->description . "' ></p> </article>"; //image doesn't work!! // If the page has children, then render navigation to them under the body. // See the _func.php for the renderNav example function. if($page->hasChildren) { $content .= renderNav($page->children); } // if the rootParent (section) page has more than 1 child, then render // section navigation in the sidebar (see _func.php for renderNavTree). if($page->rootParent->hasChildren > 1) { $sidebar = renderNavTree($page->rootParent, 3); // make any sidebar text appear after navigation $sidebar .= $page->sidebar; } So my questions : I don't like it, way too much concatenation and I'm lost between " and '. How I should do that? Why this template is not similar to main.php with a part in php and one in html? In fact, my problem is that I'm not sure how to mix them Why page->body doesn't throw all fields of the template? More specifically, what is it? I can't find it in the cheatsheet... Why basic-template.php have an open <? php but any closing bracket? Thanks!! Mélanie
  11. Thanks for your answers. I decided to give a shot and try version 3. To be honest, I don't really know what is namespace and what to do with it but since I start from scratch, it may be better to go with the future stable version. I don't think I will really need modules other than the core so it shouldn’t be a problem. Next step is now finding my design...
  12. Hi, I'm in process to convert my existing website to another CMS. After extensive searches and trying tons of demo, I found this one. I played the demo and also create a local install. It seems great, and will probably fit my needs, mostly because of the built-in multilingual support. I currently tried the 2.7.2 version but I was wondering if I should start developing on the beta version? Is it to a level enough stable or I should go with something more stable but without the new functionnalities? I expect to work for the next weeks (maybe all the summer) on my website, since I have to learn, build the skeleton and I have a lot of content to transfer. Thanks Mélanie
×
×
  • Create New...