Jump to content

I am trying to find a solution for blocks used here on the site and for that I need a way to match urlsĀ  to echo out content. This is because the widget areas are global so in a database for example that block will show up on listings and entries alike, which is not a good thing.

Now I can simply use a URI match like this:

$host = $_SERVER['REQUEST_URI'];
if($host == '/projects/')
{
    echo ('

<div class="hero_block projects_hero">
  <div class="hero_block_left_wrapper">
  <div class="hero_block_left_content">
  
    <h1>My Projects<span>.</span></h1>
    <p>
    On this site you can find all kind of things related to IT development and topics such as Atlassian, Security and E-Commerce. The purpose of this website is to help people like you with questions you might have or to help promote you and your abilities.
    </p>
    <p>
      There are no stupid questions here and you will always be treated with respect. Some features on this site is only available for members, such as the ability to guest blog or post in the forums. Most is available without you needing an account, but if you want to help me expand this site, then I would be very happy if you choose to become a member!
    </p>
    
    
   <a class="ipsButton ipsButton_veryLarge ipsButton_important" href="https://jimiwikman.se/contact//"><b><i class="fas fa-envelope-open-text"></i>    Contact me regarding project opportunities</b></a>
    
   </div>  
  </div> 
</div>
<div style="clear:both;"></div>
');
}


else
{
    echo('');
}

This will just output a set of HTML on theĀ  URL https://jimiwikman.se/projects/.

This works fine, but I also want this to show up on all pages when using the pagination.

So I can manually add each page, but that is a lot of manual work. Since all pages have the same URL structure I want to add a wildcard to the url match: https://jimiwikman.se/projects/page/*

The question is just how I do that?

Ā 

  • Replies 1
  • Created
  • Last Reply
Expand topic overview

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Expand topic overview

Featured Replies