Store Front Contact Us Projects Blog PHP Tutorials Community Forums Support Downloads Client Area Homepage
Insane Visions
Insane Visions - Top Navigation

Welcome Guest!. Please Login or Sign-Up to use some features of Insane Visions

Insane Visions :: Viewing Topic - Truncate Stories...
Home > OneCMS    



edstittle




Joined: 05/29/08
Posts: 11
Online Tag:




User is Online
Posted: 05-29-08 08:39 PM

Hey People...

First of all, congrats on the great CMS. I've been experimenting today with it as I'm going to be using it in the next re-design of my website and it's far easier than I though it would be.

Just having a difficulty...

Is there any way I can truncate news (and probably other articles) titles. So for example if I had...

"Halo 4 Announced for the Xbox 360"

...and and wanted it truncated to eg. 20 characters it would automatically be put to...

"Halo 4 Announced for"

The reason I'm asking is because I have latest content appearing on my homepage and some of it appears in full columns and the titles are spreading onto 2 lines which wrecks my layout.

While I'm here may I also ask about Custome Fields... I've been experimenting with these but most of the time when I implement them into my template it just displays {nameoffield} rather than what's in the text box from the chosen article. Have other people had this problem and is there like a quick solution to it?

Thanks for your help x.






admin




Joined: 02/10/07
Posts: 367
Online Tag:




User is Online
Posted: 05-30-08 11:18 AM

Hello,

Glad you like the CMS. :)

As for the character limit, I'd try something like this:

substr("{subject}",0,20)

Try that out, may not work and if it doesn't I'll look at some alternatives.

As for custom fields, make sure you have the exact field name and it may be a good idea not to have spaces (ex. field_name, field, etc.). Capatilization is important, having {field_name} if the name is "Field_name", it won't display the data.

If that isn't the problem I'll check it out and see what's the problem.

Thanks.






edstittle




Joined: 05/29/08
Posts: 11
Online Tag:




User is Online
Posted: 05-30-08 12:36 PM

Yeh it really is an awesome script. There's only like IGaming and GameCMS as your competitors as far as free scripts, and I've spent a fair bit of time with all 3 now and have to say OneCMS is by far the best. I just maybe think if you perhaps changed the name to something gaming relating and maybe got a seperate domain for it you'd see a huge increase in downloads as your SEO would rocket.

Thanks for the quick reply. I think the capitalisation thing has fixed all my issues with that.

Sorry I am a complete novice lol regarding the truncating. I tried my best at trying what you said but not sure if I implemented it correctly so can't tell you if it works or not.

http://www.nintencast.com/demo/temp.htm

^^^ There's the template code and I highlighted both the tags I would like to truncate ( name and Short ). What would they be looking like once your suggested code had been edited in?

Oh, and if you're interested with how the designing's going the sites installed http://www.nintencast.com/demo/ and obviously once I finish it'll be moved to http://www.nintencast.com and replace the current.

Thanks again .






admin




Joined: 02/10/07
Posts: 367
Online Tag:




User is Online
Posted: 05-30-08 02:11 PM

For the template, try changing the tag - {name}, with:

[PHP]echo substr("{name}",0,20);[/PHP]

EDIT: I can't get all the php to show, but replace the [PHP] with the < ? php, replace [/PHP] with ? >. (no spaces)

You should be able to do the same with short, just replace 20 with the limit you want with the {Short} tag. (like 200 or whatever)

As for OneCMS and the name, I actually was tempted to change it but OneCMS is too widely known (especially google-wise). When I thought of doing a general CMS I almost made it for OneCMS, but the same problem - too widely known and downloaded.







Insane Visions - Footer
Loan - Mortgage Calculator - Homeowner Loans - Credit Card Consolidation