Jump to content
IPSGoza

Adjusting URL to your site


To make your news template work for your community, we need to adjust some links that points to your community.

There are some areas you would need to change:

  • News Article Display > record
  • News Article Listing > categoryHead
  • News Article > Index

 

Article Display

Firstly, we'll start News Article Display > record.  At the top, you will noticed this code:

<li><a href="{pageurl="news"}"><i class="fa fa-angle-left"></i> Blog Home</a></li>

If your news page is called news then you don't have anything to worry about. But if your page is called differently then you'll want to change news to your page. What {pageurl="news"} mean is your site address (example: www.yoursite.com/{pageurl="news"}). News is whatever page name is called. 

Article Listing

Secondly, we'll start News Article Listing > categoryHead. At the top, you will noticed this code:

<header class="cCmsDatabasePageHeader">
	<div class="cCmsDatabasePageHeaderLogo"></div>
  	<div class="ipsLayout_container">
    	<div class="ipsPadding">
            <h1 class="ipsType_pageTitle">{$category->_title}</h1>
            <hr>
            <p class="ipsType_minorHeading">{$category->_description|raw}</p>
    	</div>    
        <nav class="cCmsDatabasePageHeader__nav">
            <ul>
                <li {{if strpos( \IPS\Request::i()->path, '/news' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
                  	<a href="{pageurl="news"}">Recent</a>
                </li>
                    <li {{if strpos( \IPS\Request::i()->path, 'news/ips' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
                        <a href="{pageurl="news/ips"}">IPS</a>
                    </li>
                    <li {{if strpos( \IPS\Request::i()->path, 'news/other' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
                        <a href="{pageurl="news/other"}">Other</a>
                    </li>
            </ul>
        </nav>
  </div>
</header>

Again, as previously stated. If your site page is different than news, you can change it. If you have more categories in your news, you can add this code and adjust to your sites categories.

<li {{if strpos( \IPS\Request::i()->path, 'news/other' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
	<a href="{pageurl="news/other"}">Other</a>
</li>

Article Index

Thirdly, we'll start modifying News Article > Index. Again, at the top, you will notice this code. It very similar to the one above, but there's a slight different code. 

<header class="cCmsDatabasePageHeader">
	<div class="cCmsDatabasePageHeaderLogo"></div>
  	<div class="ipsLayout_container">
    	<div class="ipsPadding">
            <h1 class="ipsType_pageTitle"><a href="{pageurl="news"}">{$database->_title}</a></h1>
            {{if $database->_description}}
          		<hr>
            	<p class="ipsType_minorHeading">{$database->_description}</p>
          	{{endif}}
    	</div>    
        <nav class="cCmsDatabasePageHeader__nav">
            <ul>
                <li {{if strpos( \IPS\Request::i()->path, 'news' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
                  	<a href="{pageurl="news"}">Recent</a>
                </li>
                    <li {{if strpos( \IPS\Request::i()->path, 'news/ips' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
                        <a href="{pageurl="news/ips"}">IPS</a>
                    </li>
                    <li {{if strpos( \IPS\Request::i()->path, 'news/other' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
                        <a href="{pageurl="news/other"}">Other</a>
                    </li>
            </ul>
        </nav>
  </div>
</header>

If your page url is differently, then we'll need to change it. 

Note

In News Article Listing > categoryHead and News Article > Index, these code seems the same but they act differently. The first line of code, if you're not on news page then don't active and the second line of code, if your on news page use active code. This is somewhat of a workaround I have found it be activate when your on news page or not. 

 <li {{if strpos( \IPS\Request::i()->path, '/news' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
   
 <li {{if strpos( \IPS\Request::i()->path, 'news' ) !== FALSE}}class='cCmsDatabasePageHeader__navActive'{{endif}}>
×
×
  • Create New...