Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 06:17:18 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Page titles as file name - is it possible ?!  (Read 1784 times)
noway

Offline Offline

Posts: 9


« on: January 21, 2008, 07:25:05 PM »

I`m need that my pages file name was taken not from "menu title" string but from "page title" instead. For example: menu string on page - "My favorite programs", but I wish that file name of this page will be very short - "favorite.php" (not my_favorite_program s.php).

I'm found such solution: in module admin\pages\settings2.php in lines from 118 till 128
replace
  page_filename($menu_title)
with
  page_filename($page_title)

and in search module search\search.php in line 233 string
  $page['page_title']
need to replace with
  $page['menu_title']


Everithing work fine (as I wish), but I'm not sure that there was all needed correction.

Is anybody have more perfect solutions of my problem? (may be additional field "File name" to leave page_title untouched).
« Last Edit: January 26, 2008, 09:48:04 PM by noway » Logged
marathoner

Offline Offline

Posts: 495


« Reply #1 on: January 22, 2008, 06:51:36 PM »

Why don't you simply to "Modify Page Settings" can change the Page Name to "favorite.php"?
Logged
noway

Offline Offline

Posts: 9


« Reply #2 on: January 22, 2008, 07:03:13 PM »

Why don't you ... change the Page Name to "favorite.php"?
Because there is no such field - "Page Name"  shocked
There only "Page Title:" and "Menu Title:"
Logged
marathoner

Offline Offline

Posts: 495


« Reply #3 on: January 22, 2008, 08:03:21 PM »

I'm just curious...why is the actual filename important? Do you want to display it somewhere?
Logged
noway

Offline Offline

Posts: 9


« Reply #4 on: January 23, 2008, 06:31:59 AM »

I'm just curious...
I don`t care about is it "curious" or "not curious" - I just need this feature. Even more - I don't want to see "/pages/" in url of my pages (but this is another question).

So... can anybody realy help me to solve my problem: I need to set page file name manualy and it must be differ from corresponding menu title.

Simple question... I hope solution must be simple to smiley
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #5 on: January 23, 2008, 09:51:50 AM »

Hello,

if you wanna have your personal page names you only can do this manually. Simply don't use the builtin menufunction, create the pages with the names you wish and hardcode the menu in your template.

If you wanna have this automized you need to rewrite some corefiles of WB (and even some modules)

To your second part with the pages dir. You can change this in the advanced settings of WB. But this should be done before creating the first page. Changing this on an existing page can cause that all generated pages are no more reachable. Setting Pages Dir to root only works if your hoster allows to create files with scripts in the root. But i do not recommand with 2.6.7 to use another pages directory than /pages as some modules and even core files of WB have the /pages dir hardcoded. For the corefiles we will fix this in the next version.

Matthias
« Last Edit: January 23, 2008, 09:57:06 AM by ruebenwurzel » Logged
noway

Offline Offline

Posts: 9


« Reply #6 on: January 23, 2008, 10:13:05 AM »

... you need to rewrite some corefiles of WB (and even some modules) ...
Yes! I want definitely this! And I was found possible solution.
But the very first my question was: "I'm not sure that there was all needed correction".
Is here any WSB user which already done this and can tell me is this enough, or impart to me his own "best practice"?
Logged
marathoner

Offline Offline

Posts: 495


« Reply #7 on: January 23, 2008, 04:13:59 PM »

@noway
The reason that I was curious was I thought that there may be a different way to solve your problem without rewriting core files and modules. Your tone seems quite strong for someone looking for free advice. Have fun rewriting core files and modules!
Logged
noway

Offline Offline

Posts: 9


« Reply #8 on: January 23, 2008, 06:09:52 PM »

@noway
....Your tone seems quite strong for someone looking for free advice...

No, no, no!!! There is not "bad" tone. There is only MY BAD ENGLISH  cry (which is not my native language). Sorry if I offend somebody. Don't pay any attention on the "tone" of my post, take a look only on the core of the problem. I'm realy looking for advice. Sorry, once more.

A few words about the history of problem: my site will be in russian, so, menu title (for example) for page "My favorite programs" (is very easy to understand and remember in english) in russian transcription will become a stupid transliteration like "moi_lyubimye_progra mmy". That is why I wont to manualy set page name to simple "favorite" and URLs of my pages will become short, clear and easy to remember
« Last Edit: January 23, 2008, 06:37:04 PM by noway » Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2859



WWW
« Reply #9 on: January 23, 2008, 08:10:08 PM »

Since your problem isn't answered yet by another wb user I think testing it yourself might be an answer to your solution

You wrote:
Quote
I'm found such solution: in module admin\pages\settings2.php in lines from 118 till 128
replace
  page_filename($menu_title)
with
  page_filename($page_title)

Everithing work fine (as I wish), but I'm not sure that there was all needed correction.
Everything work fine.... if so you have found your own answer

One other option,without editing the corefiles, I can think of is copying the 'odd' filename to an easier filename
The content of each wb-created page (file) is simple enough to follow


Have fun, and good wb-ing Wink

John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
noway

Offline Offline

Posts: 9


« Reply #10 on: January 23, 2008, 08:50:02 PM »

One other option,without editing the corefiles, I can think of is copying the 'odd' filename to an easier filename
The content of each wb-created page (file) is simple enough to follow
Sorry once more... I can`t understand nothing in you reply  huh
Please be patient to a foreigner and speak with him as with a "baby"...
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #11 on: January 23, 2008, 10:30:23 PM »

I`m need that my pages file name was taken not from "menu title" string but from "page title" instead.
i see a need for this in general , too.

Quote
I'm found such solution: in module admin\pages\settings2.php in lines from 118 till 128
replace
  page_filename($menu_title)
with
  page_filename($page_title)

Everithing work fine (as I wish), but I'm not sure that there was all needed correction.
This seems to be all what you have to change (as far as i can see).
But you can't use module "menu_link", without changing that, too!

Will try to implement this in WB2.7

BTW:
Quote
in russian transcription will become a stupid transliteration like "moi_lyubimye_progra mmy"
would be a pleasure if you could provide a better one. I made this "stupid transliteration", following ISO 9:1995 (without the accents - we can use pure ASCII only!) - because we needed one, and i doesn't know anything about the Russian language and Cyrillic characters.  embarassed

thorn.
Logged

vizmotion

Offline Offline

Posts: 107


« Reply #12 on: January 24, 2008, 03:32:04 AM »

Another thought.

I ran into this issue the yesterday when I wanted for SEO purposes to give my files a different name than the menu name. I decided that it did not make enough of a difference to change the code but it would be nice to have a mechanism to be able to change the file name.

The best idea seems to be the default still worked the same as now but you could override the file name if you wanted. Thanks.
Logged
noway

Offline Offline

Posts: 9


« Reply #13 on: January 24, 2008, 07:44:12 AM »

I made this "stupid transliteration", following ISO 9:1995 (without the accents - we can use pure ASCII only!) - because we needed one, and i doesn't know anything about the Russian language and Cyrillic characters.

Your transliteration is perfect - don't worry Smiley It become "stupid" because it is very unordinal (for "cyrillic eye") view russian texts composed with latin leters. Many russian-speaked peolple know commom english words, and it is much easy to use and understand it instead of direct transliteration.

Will try to implement this in WB2.7

As for me, the most common solution wil be next. WB must have individual fields for every part of page, i.e.
  • PageTitle
  • PageFileName
  • MenuText (which is points to this page)
  • MenuHint (for place it in popup or in status bar)
The defaults for PageFileName and PageTitle (if there are empty) - MenuText (transliterated by ISO)
Maybe it will be useful to setup PageFileName even with full path from the root directory (I`m yet not sure about this).

Can you additionaly tell me about posibility of such realisation? When it may be ready? Do you need any additional help from me in this process (may be as betta-tester)?
Logged
doc
Guest
« Reply #14 on: January 24, 2008, 08:19:36 AM »

Hello,

this feature will most likely not be implemented to WB 2.7 as such a solution needs proper testing and should not be implemented in a rush. We will discuss and check this out, but at this stage we can not promise to integrate this features into WB 2.7.

However, once a solution was found, we will post it here in the forum.

Regards Christian
Logged
noway

Offline Offline

Posts: 9


« Reply #15 on: January 24, 2008, 12:05:34 PM »

Thank you very much for attention to my problem!

I will wait for your right solution. The only thing which I want you to ask - take into consideration that I, and maybe other WSB-users (reader of this thread) will use my solution (with correction of core file). So, it will be great, if yours next releases in some way will be able to transparently upgrade this modified structure of pages, its (nonstandart) names and its (nonstandart) layout on disk.

Thank to all for yours assistance smiley
Logged
doc
Guest
« Reply #16 on: January 24, 2008, 04:59:44 PM »

Hello,

it is up to the user to take care that changes introduced to the core files will be re-introduced by the user when upgrading to the next version, not to the developers of WB.

So feel free to implement what ever tweak you want to the core files of WB, but keep in mind you have to take care when upgrading to a newer version.

Regards Christian
Logged
noway

Offline Offline

Posts: 9


« Reply #17 on: January 26, 2008, 09:46:49 PM »

I was found once more place which must be corrected:
in search module search\search.php in line 233 string
  $page['page_title']
need to replace with
  $page['menu_title']

This is because in page_title now we place file name, but in search results we need to see some text. So menu title is more informative than file name.
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!