Jump to content

Manaus

Members
  • Posts

    212
  • Joined

  • Last visited

Contact Methods

  • Website URL
    https://www.coloriamoci.it

Profile Information

  • Gender
    Male
  • Location
    Turin, Italy

Recent Profile Visitors

17,485 profile views

Manaus's Achievements

Sr. Member

Sr. Member (5/6)

20

Reputation

6

Community Answers

  1. I read on the documentation about `find`: So `get` should fetch also unpublished pages. Still not working... I'm using it through the `child` method, I guess `child` inherits `get` functionalities right?
  2. On page A I'm trying to get some fields data from page B, which I need to be hidden/undiscoverable. I'm using `$pages->get` method, but as soon as I make page B hidden/unpub, page A returns error. How can I workaround this? Thanks!
  3. Hello, I need to implement such protocol on my website, is there any resource I can leverage for using it on my website? Thank you very much
  4. Thank you all, I checked and the value does not exist. Since the code that gives problems is used inside an included file (a header) I should foresee whatever case arises: existence or non-existence, etc. Da2's solution works, but I wonder if Twig crashes so easily on a typical conditional case, and if there isn't a pure Twig approach to use. Thanks
  5. In my template I have set a variable called 'noindex'. Now, in my Twig template I cannot seem to use a conditional like this: {{ if page.noindex }} <do this> {{ endif}} because "Method Page::noindex does not exist or is not callable in this context" Should I put all the values within a `view` object, and pass it to the template? Is there a shortcut? I remember that within Smarty it is permissible to use `{ page->index }` within a template, and it works. Thank you very much
  6. Had the same problem, solved by removing the ScheduleCloudBackups module.
  7. Hi, I have a page where I have placed a custom field that has Lorem Ipsum as the label and lorem_ipsum as the name. On the page hosting that field, I would like to print the label. How can I do this? I tried `$page->lorem_ipsum->label` but it doesn't work. To investigate the problem further, I also tried `$page->lorem_ipsum->body`, in case there were several methods to access the various properties of the field. I also tried `name`, but the CMS still considers the field `$page->lorem_ipsum` as non-object. Can I print out the field name without going through the `$fields` object? Thanks
  8. Hello, what is the best way to insert images within the text? Is should be simple and straightforward. I'm using SimpleMDE. Thank you very much
  9. I have never understood what the purpose of render() is. Sometimes I see it applied to the $page object, sometimes to an image, sometimes to an input field object. I searched the cheatsheet, but couldn't find much. I couldn't find any references or explanations in the forum either. Where could I learn what this method is and how it works? Thanks
  10. I like the syntax expressed on the ProcessWire homepage: echo $pages->get('/')->children->each('<li><a href={url}>{title}</a>'); where html tags are generated only if the selector returns results. In contrast to such a code: <li><a href="<?= $page->httpUrl ?>"><?= $page->title ?></a></li> where the external tags are generated anyway. I read that `each` works for WireArrays, is there a method applicable to only one element? for example: echo $pages->get(10)->someMethod('<li><a href={url}>{title}</a>'); Thanks!
  11. I'm querying 3 pages, with this code: <?php function dateToItalian($unixtimestamp) { setlocale(LC_TIME, "it_IT.utf8"); return ucwords(strftime("%a %d %B %Y", strtotime($unixtimestamp))); } ?> <?php foreach ($page->children as $child): ?> <p> <?php echo $child->created." "; echo dateToItalian($child->created); ?> </p> <?php endforeach ?> I get this: 1685722140 Thu 01 January 1970 1685723334 Thu 01 January 1970 1662705715 Thu 01 January 1970 Anyone can explain why?
  12. Thanks Jan, but I can't get it to work It returns 'Undefined variable: loader' when I load the page... I think the code you are quoting is suitable for the Symfony context?
  13. I'm using TwigTemplateEngine for an Italian website, but I get always English dates for `{{ page.created }}` code. I installed the Languages Support module, Languages, Italian Language Pack, used `setlocale('LC_TIME', "it_IT")`, `setlocale('LC_TIME', "ita")`, and the various combinations with LC_ALL, but no. How can I output an Italian date on the page? Thanks!
  14. Hello, I am building a page of events, where I want to show only the coming ones. I tried this <?php $theNow = new DateTime(); // ora foreach ($page->children as $child): $firstDate = new DateTime(); $firstDate->setTimestamp( $child->event_when ); $interval = $firstDate->diff( $theNow ); echo $interval->s; // in seconds if ($interval >= 0) { // show article } ?> Beside returning a `Object of class DateInterval could not be converted to int` error, I ask if there is a method for displaying future events beside this. Thanks!
  15. I need to see some of the pages content in the Pages tree, for a specific template. Is it possible? Creation dates, a couple of fields content etc. Thanks
×
×
  • Create New...