News:

Wondering if this will always be free?  See why free is better.

Main Menu

Re naming menu tabs

Started by Topman, April 15, 2013, 03:34:40 AM

Previous topic - Next topic

Topman

I have some additional menu tabs that someone on here was kind enough to sort out for me in the index.php file if I remeber.

Anyway........when I added pretty URLs it re wrote these menu links too and now they don't work.

I have tried using  301 re directs but these dont seem to work either.
here is an example:

RewriteEngine On
RewriteRule ^forum/smf//buying-a-new-home.htm$  /buying-a-new-home.htm


the two // are on the menu tab url.
Can anyone advise  me how to get around this?

kat

Seriously?

Personally, I'd say "Dump Pretty URLs. It's more trouble then it's worth".

All Colours Sam

How exactly did you add these urls?  how are they written?
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Biology Forums

Quote from: K@ on April 15, 2013, 05:48:59 AM
Seriously?

Personally, I'd say "Dump Pretty URLs. It's more trouble then it's worth".

I agree.

Topman

Quote from: Suki on April 15, 2013, 09:08:52 AM
How exactly did you add these urls?  how are they written?

I didnt add them someone on here kindly re wrote the index.templte.php file in the default theme for me.
Ihave found them here:
<td class="maintab_' , $first , '">&nbsp;</td>
            <td valign="top" class="maintab_back"><a href="/buying-a-new-home.htm">Buying a new home</a></td>            <td valign="top" class="maintab_back"><a href="/information-for-moving-to-a-new-home.htm">Information &amp; Moving advice</a></td>            <td valign="top" class="maintab_back"><a href="/new-home-news-information.htm">News</a></td>            <td valign="top" class="maintab_back"><a href="/snagging-and-quality-issues-with-new-homes.htm">Snagging &amp; Quality</a></td>            <td valign="top" class="maintab_back"><a href="/finding-a-brand-new-home.htm">House builders</a></td>            <td valign="top" class="maintab_back"><a href="/help-to-resolve-problems-and-defects.htm">After you move in</a></td>';   // The end of tab section.
   echo '
            <td class="maintab_' , $last , '">&nbsp;</td>
         </tr>  </table>';  }
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')   {
   global $settings, $buttons, $context, $txt, $scripturl;

   // Create the buttons...
   foreach ($button_strip as $key => $value)
   {
      if (isset($value['test']) && empty($context[$value['test']]))
      {
         unset($button_strip[$key]);
         continue;
      }
      elseif (!isset($buttons[$key]) || $force_reset)
         $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

      $button_strip[$key] = $buttons[$key];
   }

   if (empty($button_strip))
      return '<td>&nbsp;</td>';

   echo '
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}

?>


I quite like the Pretty Urls and do not agree it is more trouble than it is worth.
I can identify which topics and threads get the most traffic really easy and I think it has improved my serps too.

mashby

Can you get rid of this?
RewriteEngine On
RewriteRule ^forum/smf//buying-a-new-home.htm$  /buying-a-new-home.htm

Not entirely sure how/why prettyURLs is getting in the way, but I don't know enough about it to say. The thing above is generating a link that doesn't exist which I realize is something you are trying to fix but the above isn't working either.
Always be a little kinder than necessary.
- James M. Barrie

Topman

I have deleted the extra "/" in the index template so now the urk is correct.
I have tried the
RewriteEngine On
RewriteRule ^forum/smf/buying-a-new-home.htm$  /buying-a-new-home.htm
In mt root .htaccess and in /forum/smf  adding to the pretty urls .htaccess and also in /forum/smf/themes and forum/smf/themes/default using a new .htaccess file.

All out of ideas now.
301 Rewrite should work, or does Pretty urls override it?

kat

Sorry, TopMan. This seems to have dropped off the radar. :(

From the experience I've had, Pretty-thingy can cause all sorts of problems. Have to tried disabling it, or uninstalling it, even if only temporarily?

Topman

Hi K

Just Uninstalled pretty URLs and deleted from the webspace completely.

But surprisingly the menu tabs still have the wrong url.
All very confusing as perhaps pretty urls isnt the cause, it just coincided with the pretty url installation.

Reinstalled pretty and enabled it again,
All still a mystery to me.

kat

Got a link to the page where this is happening? It needs to be accessible to guests, obviously.

Topman

It happens on every page as they are menu tabs.
See http://www.brand-newhomes.co.uk/forum/smf/index.php  for example.
The tab block to the right of Register tab.

kat

Right. Let's pick an example. The menu item "After you move in" is, currently, pointing to:

http://www.brand-newhomes.co.uk/forum/smf/help-to-resolve-problems-and-defects.htm

Where should it be pointing to?

You see, the code you posted doesn't, actually, contain any URLs, that I can see. So, can you attach your indextemplate.php

Topman

The URLs were in the code.
<a href="/help-to-resolve-problems-and-defects.htm">After you move in</a></td>
As I was typing this replyusing the full  url address http://www.brand-newhomes.co.uk/....etc
I tried this in the index.php template code and hey presto it works.

Many thanks for your help with this.
You have guided me through what I needed to do and helped my think a solution  through logically.


kat

Always the best way, I reckon. :)

Glad you're sorted, mate.

Advertisement: