-
Posts
533 -
Joined
-
Last visited
Everything posted by adrianmak
-
Is it possible, pw out-of-the-box core modules, able to build something like below mockup screen, drag to intent a page as a second level of menu navigation.
- 75 replies
-
How to implement like as your screenshoot ? I'm going to use pw's out-of-box functionality and core modules to build a menu navigation, allow people to select which page to show on an menu navigation. I knew that Page field in the right module for selecting pages.But in your screenshot, u can have three fields in a row, text, page and url Which technique u used ?
-
I just setup a sandbox dev to try. But I don't know, as u said, how to add depth ? Let say, I want "Child page example 1" be the child of "child page example 2"
- 75 replies
-
I see....I see I misplaced the source and target
-
products-index.php <?php // debug message $content = "debug msg: This is a product index page."; $page_title = $page->title; $childpages = $page->children(); $layout = wireRenderFile("products-index-tpl", array('childpages'=>$products)); // output $content .= $layout; products-index-tpl.php <?php $out = ""; foreach($products as $product) { $out .= $product->title . "<br/>"; } echo $out; I found that $products is null/empty in products-index.tpl.php. Then, I print the $childpages at products-index.php, the variable has a value, pages id(s) If I didn't the wireRenderFile method and put back the foreach loop from products-index-tpl.php into products-index.php. IT WORKS.
-
with this implementation of menu builder, from the screenshot, it support only top level of navigation. could i add another page as a child of another page in top menu navigation?
- 75 replies
-
Many thanks~~~~
-
These two api is convenience for developer for next adjacent page of current page. But it only work for, in the order of pages creation How could it possible for, let say I generated a list of pages and sorted by a date field. That's the actual page order listed in the back-end is different from the front-end. if I used $page->prev and $page->next, it reflect the order of the back-end but not the front-end (pages sorted by date)
-
Regarding page reference for page/product's categorization
adrianmak replied to adrianmak's topic in General Support
I see~~~~~~ -
Regarding page reference for page/product's categorization
adrianmak replied to adrianmak's topic in General Support
Last night, I implemented the custom php code to find selectable pages. Pages structure Here is my code The categories of pages under "News" pages could get the right categories from "Categories" correctly. However, PW returned an error with a selected category of this page. "Error saving field "categories" - Page 1046 is not valid for categories (Page 1046 does not have required parent 1) PS it's working for the "Recycling Library" -
Let say, I have following page structure Home +-------Sample page 1 +----Child page 1.1 +----Child page 1.2 +----Child page 1.3 +----Child page 1.4 +----Child page 1.5 +-------Sample page 2 +----Child page 2.1 +----Child page 2.1 +----Child page 2.1 +-------Sample page 3 +----Child page 2.1 +----Child page 2.2 +----Child page 2.3 +----Child page 2.4 While viewing a page say "Child page 2.1", How to know it is a child page of Sample page 2 , Sample page 1 or Sample page 3 Anyway, Macrura has given several api links which may fit for my requirment.
-
Regarding page reference for page/product's categorization
adrianmak replied to adrianmak's topic in General Support
Thank you very much. -
Regarding page reference for page/product's categorization
adrianmak replied to adrianmak's topic in General Support
one more question regarding page reference. From op, I grouped categories into three groups , News, Products type and Pictures type In which each group is referenced by three template independently ie News is referenced by News template Product type is referenced by Product template Pictures type is referenced by Picture template How could I create a single page field type and dynamic associated each group for each page template. Instead of create three different category input fields -
could not able to retrive categories page from a referenced page
adrianmak replied to adrianmak's topic in General Support
Eventually, I knew what causing this "issue". My field was not setup properly. I have to choose "single page......." option in the Dereference in API. -
could not able to retrive categories page from a referenced page
adrianmak replied to adrianmak's topic in General Support
I just installed a fresh copy of pw 2.7.2 with basic profile. 1. created a categories template (without a template file associated) 2. created categories pages with the above template 3. add a page field type associated with categories pages 4. add categories field in basic-page template 5. edit existing content with category selected and saved. 6. modifed existing basic-page.php template with echo $page->body . $page->categories->title; Unfortunately, it result is the same as the old one. $page->categories->title /// nothing outputted $page->categories /// category page id outputted -
could not able to retrive categories page from a referenced page
adrianmak replied to adrianmak's topic in General Support
yes, debug mode is on. And no errors generated on web page or log file. Anyway, as u suggested, I will take a fresh installation with simple setup focus on this issue. -
could not able to retrive categories page from a referenced page
adrianmak replied to adrianmak's topic in General Support
-
could not able to retrive categories page from a referenced page
adrianmak replied to adrianmak's topic in General Support
It's not working. echo $page->categories; // it will return the cat page id referenced. However, echo $page->categories->title // empty, nothing shown on the web page. -
could not able to retrive categories page from a referenced page
adrianmak replied to adrianmak's topic in General Support
anybody help? -
Here is the pages structure. the numeric in red is page id of a page. Categories page is for categorization referenced by article page template, which is pages under "Recycling Library" Let says, MRF Work Flows is categorized as Recycling Tour I want to get the categories list from viewing an article and the categories list will be put on sidebar column. When I retrieve the category page id from an article $pagecat = $page->categories; it returned 1030 (correct) Then I want to get the category title from that id $cat-title = $pages->get($pagecat)->title; It returned the site root title, that is the name Home instead of category title However, if i hard-coded the page id $cat-title = $pages->get(1030)->title; a category title returned anything wrong with using the api ?
-
how to list children pages in chronological order ?
adrianmak replied to adrianmak's topic in General Support
That is more simple than another code segment I found on another post something like $childpages = $pages->find("has_parent=$page->id, sort=post_date"); $content .= renderNav($childpages); -
what is the difference between parent and rootParent ?
adrianmak replied to adrianmak's topic in General Support
understood with this example -
I have following code segment in a template, which list all child pages of current page. if($page->hasChildren) { $content .= renderNav($page->children, array('ul'=>'article-index list clearfix', 'li'=>'article-index__item'), 'post_date'); } Currently, child pages are listed in the order of creation. The template used by child has a date field. How to order the child by this date field ?
-
$page->parent $page->rootParent