Jump to content

taoguang

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by taoguang

  1. yes,thank you. I had finish book's and author's page.

    book:

    <?php 
    	echo "<h1>" . $page->title . "</h1>";
    	foreach($page->author as $author) {
    		echo "<h3><a href=\"$author->url\">" . $author->title . "</a></h3>";
    	}
    ?>

    author:

    <?php
    	echo "<h1>" . $page->title . "</h1>";
    	echo "<h2>books:</h2>";
    	$id = $page->get('id');
    	$results = $pages->find("author=$id, limit=20");
    	foreach($results as $r) {
    		echo "<a href=\"$r->url\">$r->title</a>";
    	}
    ?>

    And can be linked to each other, but i just add one page-reference field: author.

    is it ok?

    • Like 1
  2. Hello, How to add authors to your articles?

    ex you want to create a book library management system.

    Now i add a new page named authors, then add many authors in it.

    add a new page named books,then add many books in it.

    in book template, i add new field named author, and add link to the author page in the authors.

    Can anyone tell me how to complete it step by step?

  3. Hello, I follow this post to add tags

    Quote
    • Page Reference Field 
    • Parent page to hold the tags (for example: /config/tags/)
    • Template for the tags
    1. Create the parent page /config/tags/
    2. Create the tags template (no need to have a file, and only needs one field "title")
    3. Create a Page reference field. (called tags for this example)
      a. In the settings "Allow new pages to be created from this field"
      b. input field type: autocomplete, or whatever type works for what you are after.

    Assign your "tags" field to templates where you want to allow tagging.

    Now in my template:

    $tags = explode(',', $page->tags);
    	foreach ($tags as $tag) {
    		$tag = trim($tag);
    		echo $pages->find("tags=$tag");
    	}

    But I just display the tags ID, How to display tags page's title?

  4. Now I add a PW on my domain. It runs OK.

    Then I have a second demo PW running under /demo/ subdirectory.

    and adding these code to nginx rewrite:

    location /demo/ {
        try_files $uri $uri/ /demo/index.php?it=$uri&$args;
    }

    Then I access the subdirectory's homepage(/demo/) is OK, other page return a 404 error.

    But I replaced the other cms to /demo/, It's really OK. Why?

    How to fix these errors?

  5. On 2017/8/22 at 9:58 PM, alexmercenary said:

    Has anyone managed to get PW working in a sub directory as well.

    I have PW running at route and also I have a second demo PW running under /demo/

    I have tried adding:

    
    location /demo/ {
        try_files $uri $uri/ /demo/index.php?it=$uri&$args;
    }

     but if I try to navigate to any page other that the root page (/demo/) they are broken.

    Any help would be appreciated.

    I have the same problem. I got 404 page. PLS help me!

  6. 18 hours ago, kongondo said:
    18 hours ago, kongondo said:

    Hi @taoguang. Welcome to the forums.

    For such custom markup, I recommend you make use of the getMenuItems() method as described in this post. I am happy to assist if you do get stuck.

    Cool! Thank you, With this method, Now I can do almost anything!

     

    • Like 1
×
×
  • Create New...