Welcome, Guest. Please login or register.
Did you miss your activation email?
13 May 2008, 03:38

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: News module: Extra fields  (Read 1215 times)
0 Members and 1 Guest are viewing this topic.
MichaelK
Forum Member
*

Karma: 1
Offline Offline

Posts: 129

Location: The Netherlands



« on: 09 Nov 2007, 12:35 »

Hi there,


I just installed News 2.6, great module Smiley
But how can I call the extra fields that I can add in this module?
If I make a field called image with a browse option, I upload this image with the article but how can I show it on the site?

Thanks already Smiley
Logged
calguy1000
Posts that don't follow the rules (don't ask what the rules are, read them) will be ignored, moved or deleted
Dev Team Member
Power Poster
*****

Karma: 141
Offline Offline

Posts: 3461

Location: Calgary, Canada



WWW
« Reply #1 on: 09 Nov 2007, 13:01 »

{$entry|print_r}

also...... the help has the information.
Logged

----
CMS Made Simple is Simple - For experienced developers.   You don't need to know php to use CMS but you should have some experience with website design, website development, and supporting dynamic applications in a hosted environment.   The words CSS, XHTML, and permissions should not be new to you.
Roberto
Forum Member
*

Karma: 0
Offline Offline

Posts: 24

Location: Sevilla - Andalucía



WWW
« Reply #2 on: 20 Nov 2007, 05:35 »

Hello calguy1000

I've upgraded the news module at v2.6 and I've been searching something about {$entry|print_r} in the news module help but I don't find it. Where do you say is that help?

I want to use a image inside a news (only one), but without including this image in the summary or content new. I'm interesting to know if I can use one field definitions to make this.

Thanks for your time.
Logged
MichaelK
Forum Member
*

Karma: 1
Offline Offline

Posts: 129

Location: The Netherlands



« Reply #3 on: 23 Nov 2007, 11:55 »

Hi there,

How can I add an field in News 2.0.6?
I add this line to <img src="{$entry->file_location}" alt="" width="73" height="68" border="0" align="left" />

The only thing it shows is the correct URL to this images but no text.jpg. Onlu http://myurl.com/uploads/news/id381.

I add a extra field called foto but how can I add this code?
There's no info in the Help of this module!
Logged
hexdj
Forum Member
*

Karma: 2
Offline Offline

Posts: 218

Location: California



« Reply #4 on: 23 Nov 2007, 15:46 »

Try this

<img src="{$entry->file_location}/{$entry->yourFieldName}" alt="" width="73" height="68" border="0" align="left" />
Logged
calguy1000
Posts that don't follow the rules (don't ask what the rules are, read them) will be ignored, moved or deleted
Dev Team Member
Power Poster
*****

Karma: 141
Offline Offline

Posts: 3461

Location: Calgary, Canada



WWW
« Reply #5 on: 23 Nov 2007, 15:53 »

As CMS developers you should look under Extensions >> Tags, you'll see 'get_template_vars'

if you put {get_template_vars} into any template you'll see what is currently available to smarty
if you put that inside of a foreach statement you'll see that some things are 'objects''
to see what is inside of an object use {$objectname|print_r}
Logged

----
CMS Made Simple is Simple - For experienced developers.   You don't need to know php to use CMS but you should have some experience with website design, website development, and supporting dynamic applications in a hosted environment.   The words CSS, XHTML, and permissions should not be new to you.
MichaelK
Forum Member
*

Karma: 1
Offline Offline

Posts: 129

Location: The Netherlands



« Reply #6 on: 23 Nov 2007, 17:16 »

Come 'on.

That's not the way to do it right?  Huh

I add an extra field called Foto, I added this in the News Module 2.0.6.
How can i call this this field that the jpg is in my site?

{$entry->foto} won't work. And with the {$objectname|print_r}. I get nothing  Undecided

Is it something like {$entry|foto} ?

Logged
hexdj
Forum Member
*

Karma: 2
Offline Offline

Posts: 218

Location: California



« Reply #7 on: 23 Nov 2007, 18:10 »

Did you read my previous reply?
Logged
MichaelK
Forum Member
*

Karma: 1
Offline Offline

Posts: 129

Location: The Netherlands



« Reply #8 on: 24 Nov 2007, 06:07 »

Yeah, sure!

I try this: {$entry->file_location}/{$entry->foto}.
The File_Location works fine but my uploaded image don't.  Huh

This can't be done real easy, to add a field en get it in your summarytemplate.
Almost mission impossible haha

EDIT:
I read this topic: http://forum.cmsmadesimple.org/index.php/topic,16966.0.html

and everything works fine now!!!! thanks for the help!
« Last Edit: 24 Nov 2007, 06:47 by MichaelK » Logged
calguy1000
Posts that don't follow the rules (don't ask what the rules are, read them) will be ignored, moved or deleted
Dev Team Member
Power Poster
*****

Karma: 141
Offline Offline

Posts: 3461

Location: Calgary, Canada



WWW
« Reply #9 on: 25 Nov 2007, 09:24 »

MichaelK you really need to brush up on your smarty..... all of the variables that you need are there, all you need to is some smarty debugging to find them, as I've said dozens of times already in various posts.  {get_template_vars} will tell you what smarty variables are available.  if the variable is an array or an object, you can use {$variablename|print_r} to see what's inside it. 

Logged

----
CMS Made Simple is Simple - For experienced developers.   You don't need to know php to use CMS but you should have some experience with website design, website development, and supporting dynamic applications in a hosted environment.   The words CSS, XHTML, and permissions should not be new to you.
aozuas
Forum Member
*

Karma: 1
Offline Offline

Posts: 88


« Reply #10 on: 10 Dec 2007, 13:12 »

Sorry, but...
I still didn't get the difference between the "Extra:" field below "*Content:" field and a extra field that I included using the "Field Definitions".
The first seams to loose its functionality when you have the possibility to add many more fields using the new "Field Definitions". Am I right? Or have the "Extra:" field another special function?
Logged

calguy1000
Posts that don't follow the rules (don't ask what the rules are, read them) will be ignored, moved or deleted
Dev Team Member
Power Poster
*****

Karma: 141
Offline Offline

Posts: 3461

Location: Calgary, Canada



WWW
« Reply #11 on: 10 Dec 2007, 13:15 »

well, the primary differences are:

1) *Extra field is a simple line of text.... though you can use it for whatever you want, including embedding other smarty tags, etc.
2) You can sort on the value of the *Extra field if you want to.

3) The custom fields can be a text area, a line of text, or a file.
4) you can have more than one 'custom field'.

Logged

----
CMS Made Simple is Simple - For experienced developers.   You don't need to know php to use CMS but you should have some experience with website design, website development, and supporting dynamic applications in a hosted environment.   The words CSS, XHTML, and permissions should not be new to you.
streever
Forum Member
*

Karma: 2
Offline Offline

Posts: 249


« Reply #12 on: 11 Dec 2007, 22:24 »

HEy,

I am pretty sure there is a bug.

I am using a database without cms_ as the prefix, and my extra fields don't show up. I've used them on 3 other sites, and even copied those sites templates--so I am pretty sure I'm doing it right!

I have a text area! It is named, "spotlightImage"

I call it like so:

{$entry->spotlightImage}

this in the foreach statement, of course.

Nothing is ever displayed.

But, it's filled BOTH in my database, AND in the article itself.

I found the bug patch and used it--but it's still happening

PLEASE HELP CALGUY!! Cheesy SAVE ME!!! Cheesy
Logged
Pages: [1]
Print
Jump to: