GetSimple Support Forum
QUESTION Get parent url Get specifig page title etc - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Scripts & Components (http://get-simple.info/forums/forumdisplay.php?fid=11)
+--- Thread: QUESTION Get parent url Get specifig page title etc (/showthread.php?tid=10775)



Get parent url Get specifig page title etc - Riianna - 2019-04-02

Theres is get_parent( $echo=true ) template tag, but is there a get parent url ?   Rolleyes


RE: Get parent url - Oleg06 - 2019-04-02

I am not an expert in PHP, so I usually also ask questions on the forum. Here is the code I have in the file with the answers to my questions.
Code:
<?php
    global $parent;
    if ($parent) {
        echo '<a href="'. find_url($parent, returnPageField($parent, 'parent')). '">', returnPageField($parent, 'title'), '</a>';
    }
?>



RE: Get parent url - Riianna - 2019-04-02

Thanx Oleg06 that works, yes i have to ask forums, my php is "nonexistent" but im learning a bit here and there as i go Big Grin.
Carlos snippet dont give parent url, it gives current page url.


RE: Get parent url - Carlos - 2019-04-03

Ah yes, sorry.

I've removed my useless post.


RE: Get parent url - Riianna - 2019-04-11

Heres more "how to" questions.
1. How to get specifig page title? like there is snippet for content getPageContent('slug');
2. How to get specifig page image if there is one?.
3. How to get specifig page url?.


RE: Get parent url Get specifig page title etc - Carlos - 2019-04-11

1. <?php getPageField('slug','title'); ?>
2. Depends on the plugin you're using to assign images to pages.


RE: Get parent url Get specifig page title etc - Riianna - 2019-04-12

(2019-04-11, 23:54:43)Carlos Wrote: 1. <?php getPageField('slug','title'); ?>
2. Depends on the plugin you're using to assign images to pages.

1 works thanx Big Grin.
2 no plugins just regular get simple page image


RE: Get parent url Get specifig page title etc - 0zz - 2019-04-14

(2019-04-12, 00:41:04)Riianna Wrote:
(2019-04-11, 23:54:43)Carlos Wrote: 1. <?php getPageField('slug','title'); ?>
2. Depends on the plugin you're using to assign images to pages.

1 works thanx Big Grin.
2 no plugins just regular get simple page image

2. Use Custom Fields plugin to add images for pages and code
Code:
<?php getPageField('slug', 'field_name'); ?>
to get image path

3. <?php getPageField('slug',url'); ?> - will this work?


RE: Get parent url Get specifig page title etc - 0zz - 2019-04-14

In fact all this work with the main language. How can we use <?php getPageField('slug','title'); ?> on multilanguage websites? So that we can have only one component?


RE: Get parent url Get specifig page title etc - Riianna - 2019-04-22

Making horror theme to friend and frontpage template has 3 boxes with some info from specifig pages like "who we are" etc. So i try to make it dead simple for him to add page title and page image to those boxes, like getting specifig page title with link and get specifig page image Big Grin


RE: Get parent url Get specifig page title etc - Felix - 2020-04-12

More info about what fields are available here:

http://get-simple.info/wiki/config:caching-function  (bottom of page)

The good news:
Any extra fields saved by plugins (e.g customFields & il8n_CustomFields ) will also be available.