Jump to content

ÉtienneOz

Members
  • Posts

    12
  • Joined

  • Last visited

Recent Profile Visitors

1,052 profile views

ÉtienneOz's Achievements

Jr. Member

Jr. Member (3/6)

0

Reputation

  1. Thank you very much for the answer, I'll try this as soon as possible. And you're right, this is dirty testing code.
  2. Yes sorry for the lake of information. It is in a frontend template but I use a recursive function with an incrementation of a int variable so I store my subpages in an array using $article = $page->children; and call them using $article[$i]; Here is an except of the code: $parts = $page->children('template=parts'); foreach ($parts as $i => $part) { ?> <section id="<?= $part->id ?>" class="part lvl2 <?php echo ($i%2 == 0 ? 'even' : 'odd'); ?>"> <h1><?= $title ?></h1> <?php $lvl = 3; $i = 0; recursionLvl3($lvl, $i, $part, $article, $permalink); ?> </section> <?php } ?> The recursive function: function recursionLvl3($lvl, $i, $part, $article, $permalink){ echo '<section class="lvl3"> <article class="lvl4 '; echo ($permalink == $article[$i]->name ? (strlen($article[$i]->title) > 0 ? 'big"' : '') : '"'); echo ($article[$i]->name ? ' id="' . $article[$i]->name . '"' : '"'); echo'>'; createArticle($article[$i]); echo ' </article> </section> <!-- lvl3 -->'; $i++; echo '<section class="lvl3">'; echo ' <section class="lvl4">'; echo ' <article class="lvl5 '; echo ($permalink == $article[$i]->name ? (strlen($article[$i]->title) > 0 ? 'big"' : '') : '"'); echo ($article[$i]->name ? ' id="' . $article[$i]->name . '"' : '"'); echo '>'; createArticle($article[$i]); echo ' </article>'; echo ' </section> <!-- lvl4 -->'; $i++; echo ' <section class="lvl4">'; $lvl++; if ($lvl > 0 && $i < count($part->children)) { recursionLvl3($lvl, $i, $part, $article, $permalink); } echo ' </section> <!-- lvl4 -->'; echo '</section> <!-- lvl3 -->'; } and createArticle function: function createArticle($el){ // // $el->setOutputFormatting(false); // $title = $el->title->getLanguageValue('default'); // $titleFR = ($el->title->getLanguageValue('fr') ? $el->title->getLanguageValue('fr') : $title); // $titleNL = ($el->title->getLanguageValue('nl') ? $el->title->getLanguageValue('nl') : $title); echo ' <div class="close closeArticle"><span>×</span></div>'; echo ($el->title ? '<h2>'. $el->title .'</h2>' : ''); echo ($el->sous_titre ? '<h3>'. $el->sous_titre .'</h3>' : ''); echo '<div class="dates">'; echo ($el->date_debut ? '<h4 class="dateDebut"><span></span> ' . $el->date_debut . ' </h4>' : ''); echo ($el->date_fin ? '<h4 class="dateFin"> <span> ⤑ </span> ' . $el->date_fin . '</h4><br>' : ''); echo ($el->vernissage ? '<h4 class="vernissage"> <span>vernissage&thinsp;: </span>' . $el->vernissage . '</h4>' : ''); echo '</div>'; echo ($el->images ? '<img src="' . $el->images->first()->url . '" alt="" />' : '' ); echo '<div class="content">'; echo ($el->contenu ? $el->contenu : '' ); echo '</div>'; echo ($el->en_savoir_plus ? '<p class="savoirPlus">' : '' ); echo ($el->en_savoir_plus ? '<a href="' . $el->en_savoir_plus . '" target="_blank">En savoir plus</a>' : '' ); echo ($el->en_savoir_plus ? '</p>' : '' ); } The commented lines are those which cause an issue. Thank you, Étienne
  3. Hi, I'm facing an issue with no idea to solve it, even after a look on the forum and search engines. I want to output each language available for a specific field on my page but without using a foreach loop. When I try to use setOutputFormatting() function it shows this error message: Error: Uncaught Error: Call to a member function setOutputFormatting() on boolean [...] For some reason I can't use a foreach function, I'm calling each page with a conditionnal incrementation of $i ($article[$i]). It seems the issue come from here but is there a way to bypass this? Tell me if you need more information, Thanks in advance, Étienne
  4. Hi, I got an issue with this module when trying to make a fresh install with my exported profile. Everything is working well until I try to connect to the existing database. A lot of error occurs, preventing me to continue the installation. Here is a screenshot of the errors log. Any idea where is this come from? Thanks and thanks a lot for this awesome cms and community forum. Étienne
  5. You're right, I have a script which replace some characters including colons. To avoid conflict, I rewrited urls by removing "http://". I didn't expect that it will make processwire consider it as an internal url, shame on me. Thanks a lot!
  6. Hi, thanks for the answer. @apeisa, @Mike Anthony, yes you can see it at http://interstices.io/heritage/livres-textes/ (click on the first article, there is a red link on first line after the title). @Mike Anthony, do you need any further code than what is available online?
  7. Up! Nobody has an idea? At least a clue...
  8. Hi, I have an issue with external links, specified in the CKE editor field in admin, using the link button. When looking at html, it looks clean, like this: <a href="http://externalwebsite.com"></a> but on hover and on click, it redirect to my processwire website and then the specified url, like: <a href="myprocesswirewebsite/mypage/http://externalwebsite.com"></a> I guess it is a .htaccess issue but I'm not familiar with this kind of file. Thanks in advance, Étienne
  9. Indeed, I just want to export fields and templates without content. This new feature seems to be exactly what I need so I'll patiently wait. Any idea when it will be implemented to the production version ?
  10. Hi, what about profile updates? Is it possible to export profile data only in order to provide updates for users and avoid them to loose their own data?
×
×
  • Create New...