Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug in "Page Management" script.
#1
1. The fault is as follows:

a. Create a page and name it " " (one hit of the space bar) (this is a USEFUL thing to be able to do, please do not remove it. Sometimes I don't want to be forced to put text at the top of my page.)

b. Find the page in page management. You won't be able to edit it any more, since the whitespace won't be clickable when wrapped in an A tag pair.


2. What I'd like to happen (in an ideal world):

Upon encountering a page name consisting of whitespace, the page management script should replace the whitespace with "" temporarily in the table, but only for the purposes of providing something to click on and edit.

The same bug affects the 'view all pages (I18N)' plugin page, but interestingly, not the "edit navigation structure" I18N plugin page.


3. A hacky workaround:

Open another page instead, and edit the url to contain the tag name of the page with the blank title. Hit return.
Reply
#2
Quote:Create a page and name it " " (one hit of the space bar) (this is a USEFUL thing to be able to do, please do not remove it. Sometimes I don't want to be forced to put text at the top of my page.)

wouldnt it be better to add a descriptive title to the page, then use CSS to hide the title on the page that you don't want the H1 to show.

Assuming you are using [url=a. Create a page and name it " " (one hit of the space bar) (this is a USEFUL thing to be able to do, please do not remove it. Sometimes I don't want to be forced to put text at the top of my page.)]get_page_slug()[/url] to make an ID on the <body> tag, this will be easy to do:
Code:
#page_id h1 {display:none}
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#3
the_amusing_cow Wrote:Upon encountering a page name consisting of whitespace, the page management script should replace the whitespace with "" temporarily in the table, but only for the purposes of providing something to click on and edit.

the script should make a [No Title] link when it doesnt detect a Title, but this is probably failing because there is a title, but it's " " not ""
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#4
Thanks for the replies Chris.

Re: saving as " " rather than "".

If "" (no chars) is used for the title, it will not allow you to save the page to begin with - the error is "Error: You cannot save an empty page." even if a slug has been specified.

Why I think GS should generate a clickable link in the admin for pages with whitespace as their title (and possibly should allow pages not to need the title field filled in):

1. A normal user will not think of using CSS to suppress the title, if they want to avoid using a title. They'll just try not entering a title. When that doesn't work (since it doesn't), entering a blank space (or several) is the next obvious step to avoid having a title. So the use case / example is quite plausible.

2. In principle it shouldn't be possible to add a page through the interface that cannot also be removed through the interface.

3. I don't think CSS workarounds given on this forum thread are a good solution to this - it's a UI bug which is quite likely to occur for a reasonably plausible use case.
Reply
#5
A possible fix could be allowing to click not only the link, but anywhere in the line. (This would be useful not only for " " pages, but for any that has a short title)

A quick experiment to explain what I mean: edit admin/template/style.php, line 462 or so:
Code:
table td a {font-weight:normal !important;}
Change to:
Code:
table td a {display:block; font-weight:normal !important;}

However this way subpages links are not rendered properly... (the titles are shown below the "–" dash)
Some CSS expert please... ;-)
Reply
#6
Hi all

Just like the_amusing_cow I dont want the page title to be displayed at the top of the page and even if i did I would not necessarily want to put it in h1 tags.

I am not great at coding, but isn't the easiest way to deal with this simply to remove the line

<h1><?php get_page_title(); ?></h1>

from the title and content section of template.php. That way in admin you can still put page name which is better for managing content but not have title displayed on page and can put h1 tags where you like. If you have some pages where you want title on page you can always add it as part of page content in editor.

Would this work?
Reply
#7
Loopy Wrote:Would this work?

why don't you try yourself? It is easy to test
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#8
Good question.

OK It works.

What I don't know is whether there will be unexpected consequences somewhere down the line but if there are I will share on here.
Reply
#9
Loopy Wrote:What I don't know is whether there will be unexpected consequences somewhere down the line but if there are I will share on here.

Loopy,

GetSimple is very transparent. You will notice if something gets wrong
and to control you can set the option for DEBUG in gsconfig.php ON

so you will see

I doubt that it will bring problems.

Cheers. Connie
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#10
@Loopy

All of GetSimple template tags are optional.

Only <?php get_header(); ?> and <?php get_footer(); ?> are recommended if you use plugins, as some of them need these to work.

It is also recommended (to avoid server path disclosure) to have something like this at the beginning of your template file(s):
Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); } ?>
Reply
#11
I would probably use a custom fields plugin field to either toggle the title or set the title in the template.
Although this would require some code to grab the custom field for the slug in the template itself.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)