Jump to content

TomPich

Members
  • Posts

    105
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by TomPich

  1. Hello there,

    Back again for a new question.

    So I began a website for a customer and came upon a small problem that I can’t solve. I have a textarea field for which I don’t want the end user to be able to enter title or list, so I don’t want to use TinyMCE. It is supposed to be a simple paragraph. I decided to allow <strong> and <em>, so I thought using MarkDown would be a possible solution.

    I installed and used the TextformatterMarkdownExtra module, and it works fine, but VS code keeps reporting an error because it’s not able to find the class definition. Here is the code in the template :

    $md_formater = new TextformatterMarkdownExtra;
    $content = $md_formater->markdown($hero->content);

    When I implement a new instance of TextformatterMarkdownExtra (first line), VS code underscores it in red, saying that the class is not found. It can’t import it, neither. Apparently, in the final result, Processwire sorts it out because it works perfectly. But the error reporting is annoying because it may distract me from real errors.

    Am I doing something wrong?

    Many thanks in advance.

    TomPich

  2. Thank you for your answer. That was quick! ?

    Quote

    As long as you don't create a php-template file for it, you will be not able to display it under it's own path.

    That’s indeed what I read. But, even without a php-template file, when the page is published and I enter the corresponding url, it uses the basic-page.php file to display the content. It seems to act as a fall-back template. I don’t understand why.

    Just to clarify the situation. The page name is informations-generales. It uses a template named "general_informations" with some fields, but with no template file associated. The page is published. When I enter [localhost/myprocesswiretestsite]/informations-generales/, I get the basic-page.php template displayed. Maybe I missed something in the config file.

  3. Hello there,

    I’m exploring Processwire and I really like what I discovered up to now. I would like to abandon WordPress and I have quite fair knowledge in both back- and frontend dev. So, from what I saw with Processwire, it seems to really fit my needs.

    Here is my question: I need a place to store global data (like phone number, socials links, website title, etc...) and some pictures that will be used in several pages (like a logo). As per my understanding, I created a page based on a template with all fields required. This page must not be displayed in the front site (and I didn’t create any template file for it).

    When I keep it unpublished, the title of the page, in the admin page tree, is strikethrough. That may be a bit confusing for the end user (i.e. my client). And I’m pretty sure that, if my client edit this page, they will press the "publish" button instead of "save + keep unpublished". So keeping it unpublished is kind of a lame option.

    If I publish it, it uses the basic-page.php file to render (although I read somewhere that if no template file is provided, the page will not be shown). So that’s not good either.

    Am I missing something? Is there some kind of best practice that I’m not aware of?

    Sorry if I didn’t RTFM enough, but I did some research and didn’t find the answer to my question.

    Thank you,

    Cheers

    Thomas

×
×
  • Create New...