Jump to content

mel47

Members
  • Posts

    330
  • Joined

  • Last visited

Everything posted by mel47

  1. Thanks @Robin S it's really what I wanted!
  2. Sorry, I should have remove this selector, since it's not the point. Author is a PageReference field found on publication template. The field alias is a PageReference field from the template member. I want to be able to select publications for an author either by its name ($page->title) or from their alias (author could have 2 or 3 differents surnames; $page->alias). I know how to use a foreach to get a single page, but how to apply in case of a selector? $publis = $pages->find("template=publication, author.title=??") Digging around while writing this explanation, I found this $publis = $pages->find("template=publication, author.id={$page->alias}) //works ->33 pages $publis = $pages->find("template=publication, author.title={$page->title}) //works ->82 pages //but how come this doesn't work ->0page $publis = $pages->find("template=publication, author.id={$page->alias}, author.title={$page->title}) How I can combine both results in one selector?
  3. Hi, I'm searching, without success, to use all values of the pageArray inside a selector : foreach($page->alias as $al) { $publis = $pages->find("template=publication, categ_publi=$c, author.title={$page->title}|{$al->title}") } it doesn't work, but I have no idea how to get it. Thanks
  4. Hello, Thanks for your module; I read all the thread. Last year, it seems impossible to have some html in extra fields, does it works now? Anyway, if so, I'm unable, it always strip out my <a href[...] Furthermore, I'm seems unable to add more than 1 textformatter, I can just choose one (and I'm not really sure it was applied). Thanks Mel PW 3.0.51
  5. I used the module BCE. It's a "work-around", but it's do-able (if you don't want too much languages). You import 1st language. Switch your admin to the other language and re-import with second language.
  6. Yeah, I think it is the problem. I don't want to use it as a paragraph. I considering changing to a different field.
  7. Hi, I'm not sure to know how I should structure my template. I have two pages : publication.php and member.php. I want to display publications of the specific member on his page. What is the difference between using a function or render the template? For now I have (publication.php): function renderPubli ($page) { $out = ''; foreach($page->author as $a) { // PHP Warning: Invalid argument supplied for foreach() in .../sites/dev-wire/site/templates/publication.php:8 $members = wire('pages')->find("template=member, name|alias.title={$a->name}, include=hidden"); // membres qui ont comme titre $tous = []; foreach($members as $m) { $tous[$m->title] = $m; } if($members->count()){ //si une page author existe foreach($tous as $m) { $out .= "<a href='{$m->url}'> {$a->title}</a>, "; } } $out .= " <span> ({$page->year}). {$page->titre}</span> <em>{$page->journal} </em>"; ....... return $out; } and member.php foreach($publis as $p) { $out .= "<li>" . renderPubli($p) . "</li>"; } It is working, but do I should care about this PHP warning on member's page coming from publication's page? Do I could do something better? Does with render() I will have a better outcome (for now, no success)? Thanks
  8. Hi I have a simple question but I'm unable to find answer. I have a summary field with CKeditor. When I want to render this field, It always get wrapped by a <p>text</p>. But I don't want those paragraphs. How to remove them? If I use $sanitizer, it also removes other tags (<a>). Thanks
  9. Oh, my, my... I read it but it appears I didn't completely understood... So solve my problem by replace with $menu = $modules->get('MarkupMenuBuilder');//Load the module. $menu is an example $m = $pages->get(2359); echo $menu->render($m, $options);
  10. Hello, I recently installed MB on my multi-language's website in progress. I'm quite sure it was working in both languages. But since couple of days, I noticed this error Exception: No menu items found! Confirm that such a menu exists and that it has menu items. (in /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/MarkupMenuBuilder/MarkupMenuBuilder.module line 961) #0 /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/MarkupMenuBuilder/MarkupMenuBuilder.module(88): MarkupMenuBuilder->throwError() #1 /multimedia/sites/dev-wire/site/templates/_main.php(194): MarkupMenuBuilder->render('main', Array) #2 /multimedia/sites/dev-wire/wire/core/TemplateFile.php(276): require('/multimedia/sit...') #3 /multimedia/sites/dev-wire/wire/core/Wire.php(374): ProcessWire\TemplateFile->___render() #4 /multimedia/sites/dev-wire/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #5 /multimedia/sites/dev-wire/wire/core/Wire.php(402): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #6 /multimedia/sites/dev-wire/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #7 /multimedia/sites/dev-wire/wire/modules/PageRender.module(514): ProcessWire\TemplateFile->render() #8 [internal function]: ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #9 /multimedia/sites/dev-wire/wire/core/Wire.php(376): call_user_func_array(Array, Array) #10 /multimedia/sites/dev-wire/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___renderPage', Array) #11 /multimedia/sites/dev-wire/wire/core/Wire.php(402): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #12 /multimedia/sites/dev-wire/wire/core/WireHooks.php(782): ProcessWire\Wire->__call('renderPage', Array) #13 /multimedia/sites/dev-wire/wire/core/WireHooks.php(782): ProcessWire\PageRender->renderPage(Object(ProcessWire\HookEvent)) #14 /multimedia/sites/dev-wire/wire/core/Wire.php(402): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array) #15 /multimedia/sites/dev-wire/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array) #16 /multimedia/sites/dev-wire/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Page->render() #17 [internal function]: ProcessWire\ProcessPageView->___execute(true) #18 /multimedia/sites/dev-wire/wire/core/Wire.php(376): call_user_func_array(Array, Array) #19 /multimedia/sites/dev-wire/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___execute', Array) #20 /multimedia/sites/dev-wire/wire/core/Wire.php(402): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #21 /multimedia/sites/dev-wire/index.php(55): ProcessWire\Wire->__call('execute', Array) #22 /multimedia/sites/dev-wire/index.php(55): ProcessWire\ProcessPageView->execute(true) #23 {main} I'm currently running PW 3.0.50, but I'm unable to say what version it was when I previously installed. I have 2 menus, but removing one or the other give the same error. I call my menu by $options = array( 'wrapper_list_type' => 'ul',//ul, ol, nav, div, etc. 'menu_css_class' => 'topnav',//a CSS Class for the menu 'current_class' => 'active', ); $menu = $modules->get('MarkupMenuBuilder');//Load the module. $menu is an example echo $menu->render('main', $options); Do I doing something wrong?
  11. Hi @adrian For first time, I have a problem with this module, version 3.6.0. Fatal error: Call to undefined function wire() in /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireLogsPanel.inc on line 72 I tried de-install/re-install but without success.
  12. Some of my thoughts but I really don't know if it's feasible or too much error-prone. For sub-levels: Having a new field (in the CSV): sub-levels. I discovered this approach in the Menu Builder module. However, since this field doesn't exist in template, it could be confusing if we forget to add it when add or replace data. For multi-language: According to me, it shouldn't use | since they are already use for many images/pages. Furthermore, I used CSV in Excel to fill quickly in column format, so I need different CSV fields. I guess the best option is having for example: body_en;body_fr. But I'm not sure how to order the CSV since there is maybe non-multi-language fieldtypes in the template. And/or, since not applicable to CSV import-export, to add data, it could be a multilanguage area (it used when you edit a ML option's fieldtypes). But I have no idea how those things works, so I let you decide how good they are...
  13. Thanks! My lab's website. Not finish at all but I will show eventually.
  14. Hi I need to write NH<sub>4</sub><sup>+</sup> in my body field (using CKeditor). But, using source input, the marking is always stripped out and there is no button for sub and superscript. How I could achieve that? Thanks
  15. Perfect! Works as expecting when CSV is pasted. Thanks again!
  16. Version 1.4.9 You're right. Pasting CSV doesn't work but uploading file works.
  17. Again me... I have a problem I couldn't understand. I created my CSV file with " " in each column : "Article in Metabolic Brain Disease-Bosoi-2009";;"Accepted article";"Publication";2008-12-29 18:12:48;;"<p>Latest paper was published in Metab Brain Disease</p>";"<p>Latest paper was published online December 23<sup>rd</sup>.</p>";;;"Bosoi et al.-2009-MetabBrainDis" The last field is Page. Everything imports fine (no error), but last field is imported as Bosoi et al.-2009-MetabBrainDis" Why it keeps this extra " ? Thanks Melanie
  18. Seems perfect, will try those! Thanks
  19. Feel uncomfortable to ask something else, I already did so many times... But does it will be possible to mix actions "lister" and "edit"? I need to hidden some pages, but it will be so much easier if I could filter them and then selected all to hide. Thanks again so much...
  20. Thanks. I get it! The way @ottogal wrote, it didn't work. However, with your idea of array and a search on forum, I mix it with the Ryan's answer. So the final version is : foreach ($categ_team as $categ) { $content .= "<h2><a href='{$categ->url}'>{$categ->title}</a></h2>"; $cat_members = $pages->find("template=member, featured=0, categ_team=$categ, sort=-date_begin"); $years_start = []; foreach ($cat_members as $cm){ $years_start[$cm->date_begin] = $cm; } foreach ($years_start as $y){ $content .= "<h3>{$y->date_begin}</h3>"; //or apply some formatting to the $y value $members = $cat_members->find("date_begin=$y->date_begin"); foreach($members as $m) { $content .= "<h4><a href='{$m->url}'>{$m->title}</a></h4>"; } } } Thanks!
  21. Yeah, it keep repeating, 2, 3, 4 times depending of how many members have this date. Maybe it's not clear to me, but the result of $years is page id, not a year. So even if we add this ->unique(), I still get the same pageArray, already with unique values. Maybe it's my selector that is not good? I need to search for date_begin value of each member of a specific category and not just each page.
  22. Hello My list look like that. The names are in the good categories, but they are repeated. I tried foreach ($years->date_begin as $y) but it doesn't work also. Stagiaire (categ_team) 2014 (date_year) Fatma A (title) 2013 Juan B Jorge A 2013 Juan B Jorge A
  23. Unfortunately, it doesn't work. Even if I define $currentYear='' at the beginning, I obtained the same result. I guess it's normal, since in $years, I'm searching id pages and not the value inside the field date_begin of this page? Maybe it's the thing I don't understand.
  24. Hi I have a problem with a loop. I get repeated years. I understand, since I search for all member pages. But how I merged years (date_begin field, a number field)? Should be simple I guess, but I already spent hours on that... foreach ($categ_team as $categ) { $content .= "<h2><a href='{$categ->url}'>{$categ->title}</a></h2>"; //MSc, stagiaire $years = $page->find("template=member, featured=0, categ_team=$categ"); foreach ($years as $y){ $content .= "<h3>{$y->date_begin}</h3>";//les années $member = $page->find("template=member, featured=0, date_begin={$y->date_begin}, categ_team=$categ"); foreach($member as $m) { $content .= "<h4><a href='{$m->url}'>{$m->title}</a></h4>"; //nom de l'étudiant } } } Thanks Melanie
×
×
  • Create New...