Forum

Thread tagged as: Problem, Runway

Meta URL, Perch id's

When I use <perch:blog id="domain" type="hidden"/> it gets the correct URL, which is https://www.mydomain.com. But when I use <perch:pages id="domain" type="hidden"/> I get the URL without the 's' in http. Is perch:blog and perch:pages domain id different in any way?

Erick Green

Erick Green 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Where is the value of domain being set for each?

Im not sure if I understand that question. Is there a place to set the domain, and is there a seperate domain for perch:blog and perch:pages?

Drew McLellan

Drew McLellan 2638 points
Perch Support

When you use <perch:pages id="domain" type="hidden"/> where are you setting domain ? I don't think that's a special value of any sort.

<?php
    $domain        = 'https://'.$_SERVER["HTTP_HOST"];
    $url           = $domain.$_SERVER["REQUEST_URI"];

    PerchSystem::set_var('domain',$domain);
    PerchSystem::set_var('url',$url);
    PerchSystem::set_var('today', date('Y-m-d'));

    perch_page_attributes(array(        
      'template' => 'default.html'    
    ));
?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so that looks like you're setting https:// on the domain. Is that not working?

It works when using id="url", but not when using id="domain".

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so is that solved?

Not really. id="url" output is different than id="domain". I need the id="domain" for this page.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us the output of <perch:showall /> in your template?