Sten

Starter
  • Content Count

    30
  • Joined

  • Last visited

Community Reputation

9 Neutral

About Sten

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you very Much BitPoet for your help, I was able to solve adding check_access=0 in my selector. Great!
  2. What I don't understand is that the field is displayed anyway with the right data (each language has a number) but displaying the b tag.
  3. Hi BitPoet, Here is my code $texte=""; $leslangues=array(1=>"fr", 2=>"de",3=>"en",4=>"es",5=>"he",6=>"it",7=>"pt",8=>"ru"); foreach ($leslangues as $langue => $langue_str){ $element = $pages->find("template=clef, langue=$langue, limit=1, sort=-id")->first()->title; $nombre=(int) filter_var($element, FILTER_SANITIZE_NUMBER_INT); if (!$nombre){ $nombre=1; } $texte.="<b>$langue_str</b> : $nombre, "; unset($nombre); } $texte=rtrim(rtrim($texte),","); return $texte; Thank you for your help.
  4. On the module FieldtypeRuntimeMarkup I have error according to roles. As superuser I don't have any error but as contributor I have trying to Get property on non-object and the html code in the field is displayed as source. The line pointed at is this one protected function renderMarkup(Page $page, Field $field) { //if code field is empty return early if(!$field->runtimeFields) return; //locally scope $pages to eval() $pages = $this->wire('pages'); ------> $str = eval($field->runtimeFields); //since we are dealing with custom PHP code but also want to make sure that only markup is returned //if eval() returns anything other than a string or an integer, we throw an error (e.g. if an object or array is returned) if (is_string($str) || is_int($str)) return $str; //we need to check if we are in admin. Otherwise with an error, in the frontend the name of the the Fieldtype is returned if we echo out the field elseif($this->wire('process')->className() == 'ProcessPageEdit') return $this->error($this->_('Only strings and integers should be returned by your custom code! $ } Thank you
  5. Sorry I found the solution.
  6. Hello, An administrator on my last site has created a page with the template "home" by error and now this page is homepage and I can't find the real one. Could someone help me ? Thank you
  7. Arjen Thank you very much for your answer. I will change my templates structure.
  8. Hello, I have some difficulties to understand extends. How send variables through extends ? like here, may i send {{ page.title }} or {{langue_str}} to base.twig ? Base.twig is my main template with headers, footers... that extends each page. {% extends 'base.twig' %} {% block content %} <div id="titres"> <div id="titre">{{ page.title }} {{ lang }}</div> </div> <div class="hr"></div> <br> {{ include('engagement.twig') }} {{ include('lettre.twig') }} {{ intro_derniers_textes }}<br /><ul> {% for texte in derniers_textes %} <li><a href="{{ texte.url }}{{langue_str}}/">{{ texte.title }}</a></li> {% endfor %} </ul> {% endblock %} Thank you
  9. Sten

    Hi, I solved my problem, it was a regex problem in the template.
  10. Hi, I allowed urlSegments in my config and for the template I use in this case. My page doesn't give data outside title and name. This is my template : GNU nano 2.7.4 File: liste.php <?php namespace ProcessWire; if (preg_match('/^[a-z]{2}$/',$input->urlSegment1)){ $langue=array_search($input->urlSegment1, $toutesleslangues); $elements = $pages->find("template=enseignement, langue=$langue, sort=-id"); } elseif(in_array($input->urlSegment1,$cats_slug) AND preg_match('/^[a-z]{2}$/',$input->urlSegment2)){ $langue=array_search($input->urlSegment2, $toutesleslangues); $categorie=array_search($input->urlSegment1, $cats_slug); $elements = $pages->find("template=enseignement, cat=$categorie, langue=$langue, sort=-id"); } else { // throw a 404 throw new Wire404Exception(); } $langue_str=$toutesleslangues[$langue]; include_once "../langues/".$langue_str.".php"; $cat=${"cats_".$langue_str}[$page->cat]; $view->set("posts",$elements); ?> I use twig. My page works with one urlSegment works but not with two. With two, it is a 404 page. I tested every value. I don't see what goes bad. This page displays a list of urls. Thank you for any help.
  11. @Robin S. Great I'll look at it soon. Thank you Robin, I would not have done anything without your help.
  12. @dragan Than you I'll look at Tracy Debugger, I did not know it. @bernhard I'll have a look in your post and keep you informed, thank you.
  13. Hello, I'd like to participate to a documentation about the page flow in PW. I am still a beginner and still have difficulties to see the big picture but I could help to the writing. What is the flow when a page is displayed or created ? It would be fine to draw a scheme with every stage in which one can add hooks. Something to describe the flow in time. May be it exists. page | fields | template What do you think ?
  14. @Robin S Yes good idea. OK I understand why it is better haver easySlugger inside the module. Besides I have written to Javier Eguiluz to inform him about our work.
  15. @netcarver Yes sure, this is the aim with help of @Robin S