Jump to content

RuiVP

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by RuiVP

  1. I'm building a local test site with PW 3.0.165. Server Wamp, Apache 2.4, php 7.3. I created 2 templates: Articles and Authors. Template Articles has the usual content and images fields, plus: fieldAuthors (page reference to Authors pages, multiple) Both templates render all the fields ok, namely the list of referenced authors in the Article page. In template Authors I tried to make a list of Article pages related to that Author: (sorry for having some words in Portuguese; please read 'author' where 'autor') foreach($pages as $page) { if(count($page->autores)) { foreach ($page->autores as $autor) { if($autor->title == $page->title) $content .= $page->title; } } } It doesn't work. It complains about "PHP Notice: Trying to get property 'autores' of non-object in ...\www\cadppimport\site\templates\autor.php:22" BTW it makes the same complain about the line with if($page->rootParent->hasChildren > 1) { ... renderNavTree($page->rootParent, 3) ... } but in fact it renders right the navTree. What am I doing wrong?
  2. Thanks for your fast answer, @dragan This may be a bad decision (newbie's fate), but after having a look at the links you gave and taking good note of @ryan's comments on date creation/etc, I think I will go for the direct manipulation of the database. My reasons are: 1. In several aspects I want the new site to be an straightforward mirror of the old site (dates, visits, urls, etc.). 2. Creating new fields for dates goes against my opinion on what machines should be and should do. Meaning, if the final user is forced to do the machine's work and to understand the machine's entrails in order to use it, having to put there every single detail the machine should be aware of right from the beginning, we'd be better off. The user should be able to focus in only one thing: conceiving and organizing contents. For my experience, if I complicate the editing page with a plethora of fields, the users will run away and in the end I will find myself forced to edit for them, in order to keep the site growing. Now, let me take a deep breath and get the courage to make some silly questions about the proceeding: I suppose I need to put the sql query somewhere, to run once, but... Where? Is it in the template.php? Should I write a codePiece.php and put an include_once call in the template.php? (and than get rid of it). And if so, does the codePiece.php need some kind of flag or does php take good care of running only once? Please be indulgent, it is the first time I'm dealing with php, and some parts of the php manual are good for those already with some enlightenment, not for total newbies. Anyway, I'll have to find the (long) time to experiment with all this, it won't be for today. As soon as I can do it, I'll tell you about the results. Thanks again for your patience and goodwill.
  3. Thanks @dragan Sorry for asking in the first place. I realize now that there is already a lot of talking about the subject. The fact that my English is very limited doesn't help on using the right words in searches... The programmatic solution looks frightening to me, for the moment. I'll try the module solution; or, to avoid future problems with outdated modules, I'll create a date field in the PW template, since it is easy to export a date field from Drupal via csv. I can't see what means but I guess I'll get there as I put my hands at work.
  4. I'm trying to migrate a Drupal site to PW, using the export/import csv strategy. Not an easy task at all, considering I'm a total ignorant about php and PW. Lots of problems, as expected. Here's one I can't figure out how to solve. I can give up with a few things present in the Drupal site (namely the forum), but for historical reasons it is very important to keep the date published for each page, the author and the visits count. So, first problem: how to change the publishing date when editing a page? I can't find an item for that in the page editor. Is it there and I simply missed it? Thanks in advance for any clue.
×
×
  • Create New...