google-code-export / gelatocms

Automatically exported from code.google.com/p/gelatocms
0 stars 0 forks source link

Suggested changes to index.php #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using 0.95

I've been having some issues with how and when Textile is invoked. The
biggest issue is that if you feed Textile a plain string, it will by
default put <p></p> around it. This is a problem for Titles in Gelato --
they should be passed to Textile to convert styling and apostrophes, but
they should not be turned into paragraphs. (If they are, a workaround is to
edit the CSS and change all relevant <p>'s to display: inline.) Similarly,
it seems that Description should only be turned into a <p> for URL posts
and regular posts -- in other words, where you are likely to have multiple
paragraphs of text.

(For an example of the Description problem, look at the default styling in
the Tumblr theme. On Tumblr itself, the quotation marks appear on the same
line as the quote, but in Gelato the quote starts on the next line, because
Description is enclosed in <p>.)

Luckily, you can tell Textile not to add <p> by starting a string with a
space. So I dug into index.php and changed the handling of Title and
Description so that Title always gets a space prepended before it gets
passed to Textile, and Description does except for post types 1 and 4.

I also noticed that the entire switch block which calls the appropriate
template appears twice in the file, once for pages with multiple posts, and
once for pages with just a single post. So I refactored the whole thing
into a single process_post function which can be called as needed.

Original issue reported on code.google.com by aa...@sherber.com on 22 Jan 2008 at 5:05

Attachments:

GoogleCodeExporter commented 9 years ago
As I look at more of the code, I think the process_post function I created 
should
really be refactored into a global file, with different parameters. Virtually 
the
same processing takes place in admin/index.php, and the function could be 
called from
there as well.

Original comment by aa...@sherber.com on 22 Jan 2008 at 10:16

GoogleCodeExporter commented 9 years ago
Hi!! what a wonderful user, we will review them and will back to you soon :)

Original comment by peces...@gmail.com on 22 Jan 2008 at 11:47

GoogleCodeExporter commented 9 years ago
I finished the additional refactoring, putting display_post($register) in
functions.php. This is now called by index.php (first attached file) and
admin/index.php (second attached file).

I'm really excited about this product, btw. I like the idea of Tumblr, but I 
didn't
want to commit to a platform where I couldn't get under the hood and tinker.

Original comment by aa...@sherber.com on 23 Jan 2008 at 3:16

Attachments:

GoogleCodeExporter commented 9 years ago
Textile formating has gone

Original comment by peces...@gmail.com on 27 Oct 2008 at 2:36