Jump to content

mel47

Members
  • Posts

    370
  • Joined

  • Last visited

Everything posted by mel47

  1. Oh, why I don't know things so simple... Thanks!
  2. Hi Have a problem for searching pages. I have member template with 2 fields : title (example value : Mélanie Tremblay) and alias (example value : Mélanie A. Tremblay) I want to search for either those fields $publi = $pages->find("template=publication, categ_publi=$c, author~={$page->title}|{$page->alias}, sort=-year"); This selector works if both fields are filled. But if I only have title, I get an error: '~=' is not implemented in FieldtypePage. If I put only author={$page->title}|{$page->alias}, it found results only if alias field is empty. What syntax I should use? Thanks!
  3. OMG! It's just so wonderful! It works perfectly. Thanks so much!
  4. Hi Seems awkward to answer a so old post, but since I don't know what exactly searching for, I found this one with the exact same goal : adding category in the url. Unfortunately, I'm not sure to understand what to do. @LostKobrakai, by any chance, did you wrote this tutorial? Thanks Mélanie
  5. Hi @adrian Two questions : When I export as CSV a field "Page" (Unique, select), it doesn't work. However if I change to Page - multiple - ChosenSelectMultiple, it works fine. It's not a big problem, since I change to multiple even if I want only one page, but it's a little bit counter-intuitive. Is it possible to create a new page (authors) (from a field page(author)) by using BCE? I can import only pages (authors) already created. Again, I can import as first step those authors, but I would rather prefer import publications and automatically creating author. On side note, creating page is activated and works fine if I use PW interface. My tree is something like this: Publications (page) ---Author (field, type page from Author) Authors (page) ---Title Thanks again. Mélanie
  6. Hi @adrian, I don't know if I should post here but there something strange happening with Tracy 3.3.1 (in my local installation of PW3.0.33). Before this version, whatever to which page I try bd($input->urlSegment1), I always get " " as answer. But now I get "bookmarks" as result. But my url is now ".../en/publication/example1/bookmarks/", a really unusual and incomprehensible one. Now I have tons of pages like this ".../en/team/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/bookmarks/", with 404 error. When I disable Tracy, url come back to normal. But at least, now I understand a little bit the concept of urlSegment which I misunderstood... It's something we added to the regular url? In that case, it's normal I didn't get a dump answer. But I still don't understand how to change "en/categ-publi/article" to "en/publication/article" if each part of the url is not a urlsegment... I'm lost, I think... Thanks Edit: OMG, just realize I completely and totally understood urlsegment concept...
  7. Yes, on publication. But I'm not sure if it's the good one.
  8. Hi, I'm quite sure to have read everything, doc and forums, about urlSegment, but I'm still not understanding how to use it. After have set my categories with this excellent post, I'm unable to fix url as I want. Page title | Template | actual url | url I want Categ-publi | parent_categ | categ-publi/article | publication/article -- Article | categories | Publication | basic-template | publication/example1 | publication/article/example1 -- example1 | publication | For which template I should activated urlSegment and in which template file I should add some code, probably something like this (which didn't work obviously)? if($input->urlSegment1 == 'publication') { echo $pages->get('/publication/$categ/')->render(); return; } else if($input->urlSegment1) { // throw a 404 throw new Wire404Exception(); } Thanks so much. Melanie
  9. @adrian sorry for the delay. I finally was able to test it, and it rocks! html tags are now imported correctly. I still have difficulties with export : when some fields (images or files) are empty, the content of body field is replicated. Concerning multilanguage, could you give an hint of how to use it? Do I can import in 2 languages at the same time? Anyway, I discovered a workaround couple weeks ago. If I changed default language, I could import in this language. So I will do 2 imports, which is not so bad, considering I planned to used it only once to migrate my website content. Thanks
  10. Hi I read and re-read this great tutorial to learn how to set-up my templates. However, I have no clue how to get url working correctly in the case of using pages field as category. In forum's posts, I saw many times "kind-of" similar code using urlsegment, but I'm still not sure to understand the basics. Which of my template should be urlsegment activated? In which template I put this code? I was wondering if this wiki page was an example step-by-step? Does someone have still access to this? Thanks
  11. Finally get it (forgot a loop)! I wanted to avoid an extra checkbox. So : foreach($page->author as $a) { if($pages->count("template=member, title={$a->title}")){ $member = $pages->find("template=member, title={$a->title}"); foreach($member as $m) { $out .= "<a href='{$m->url}'> {$a->title}</a>,"; } } else { $out .= "{$a->title}, "; } } $out = substr($out, 0, -2); Thanks
  12. Hi, Thanks again for your answers. Since it make more sense to me, I will create authors and checking if they are members. It's works fine. My very last question. I have now a problem with url, which should link to member's page and not author's page (that will not exist) foreach($page->author as $a) { if($pages->count("template=member, title={$a->title}")){ $m = $page->find("template=member, title={$a->title}"); //why this doesn't work? $out .= "<a href='{$m->url}'> {$a->title}</a>, "; } else { $out .= "{$a->title}, "; } } $out = substr($out, 0, -2); @ottogal : wonderful suggestion, it did it so easily!
  13. I now remember why I didn't want to use pagefield for authors. The problem concerns authors which are not members (by contrast, all members are authors). So in member template: For each member : display his publi (this is fine and now works correctly). In publi template: For each publi, link to his author like this : Member 1, Author1, Member2 and Author2. There is 2 cases: Import author who are member in the page field as mentioned. Use a simple textarea to list all authors and output directly. I will lost the capability to link to member's pages. Create a new page for each author within importing. It works fine but even if I unpublished the pages, they still have an url and got a link like if they are members. How I can make the difference between authors and members? I know how to find unpublished pages with a selector but really don't know how to write the loop. When displayed on the page, they have to be in the specific order which I imported them, with a comma between names and without for the last one. Thanks again.
  14. true, it works without.
  15. Thanks everyone. The simplest solution works fine (with the "s" in pages!): $author = $pages->find("template=member, title=$page"); $publi = $pages->find("template=publication, author=$page");
  16. I'm stuck for 2 days to search how to output this pagefield. So Member (template) Publication(template). Contains a MultiPagefield called "Author". I want to output in template.php //stuff from member template (works fine) // get publication from this author $author = $page->find("template=member, title=$page"); $publi = $pages->find("template=publication, author=$author"); //doesn't work foreach($publi as $p) { $out .= "<li>{$p->title}</li>"; } Where is my error? Do I have to add a children somewhere to get all pages from pagefield? Thanks Mel
  17. Hum, sounds interesting to get authors as pagefields. I suppose I can do find this template for each member to get them displayed. So I don't need a publication field in member? Still have to see if it's possible to import, will try later this weekend. For the markup, I know, but I'm asking because I'm still unable to import html markup through CSV import. So I'm not sure what to do in that case. thanks Mel
  18. Hi I'm now understanding the basic of PW but for this one, I have no idea where to begin. I have 2 pages : publication and member. I want to add publications (automatically as I created them) to its member. Since I have hundred of publications, I want to create them using csv import. I used a specialised software to export them in the way I want. The format would be Name LastName1, Name LastName2 (2016) Title. Journal. Vol:Number. Url. I have variable numbers of authors by publication. My member's template have the title containing "Name LastName" and have a pageField "publi". How I can achieve that? I read in the forums I could assign page to a field via hooks. But I'm not sure what I should do. Also a more design question, do I should create all authors as unique fields? How I can create the good number of those fields? Or can I just create 1 author field in publi's template and search inside this value? Also for the others fields, do I should create them individually if I want to output this specific markup (italic, bold)? Hope it is clear... Thanks Mel
  19. Hi @adrian, I'm currently trying this module to import my news from my old website to PW (3.0.28). I have 2 questions: Do I'm suppose to be able to import html? All <h>, <p>, etc are lost when I import. Either by copy-paste the text or using a CSV file. I tried different ways to escape but didn't get it. I also deactivate HTML purifier and some other stuff in input tab of my body field. I have some glitchs with CSV export in images or files field. I created a mockup page (values were just the title of the field). You will see that in images/files, the content of body is copied. However, if images/files are filled, they export correctly. Thanks!! Mel PS I didn't try yet multilanguages, I hope it works!! ;-) news.csv
  20. oh my... Still have so much thing to learn... Thanks it works now.
  21. 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
  22. 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
  23. 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>"; } } } } }
  24. 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
  25. 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
×
×
  • Create New...