7 Posts
nichik
4 years ago
Topic

Please help solve the problem. The following fields are available: Author, Title, Creation Date. How to output these fields to a text string, for example, in the following form: "Author // Title - Creation Date". Thanks a lot.

Get a Book for SEBLOD
1283 Posts
Bucklash
4 years ago
9
Level 1

you could do this:

Have two of the three fields in hidden or clear position (try both, see what happens).

The other field gets rendered in template with html typo applied.

The html typo would be $cck->getValue(“art_author”) // $cck->getValue(“art_title”) - $cck->getValue(“art_creationdate”)


double check the field names ;)

7 Posts
nichik
4 years ago
6
Level 2

Good day. For some reason it doesn’t work! I tried it differently - it does not work. In addition, I also made the fourth field, in which I output the three indicated fields. I created the fourth field as Form-> Text. "I tried to display any text in HTML, for example <hr> or <p></p> ..... It doesn’t work. Most likely I'm setting something up wrong.

1283 Posts
Bucklash
4 years ago
5
Level 3

Yeah sounds weird

you in content view / list view, or a form view?

maybe some quality screenshots (ie zoomed in so they are readable etc)

7 Posts
nichik
4 years ago
1
Level 4

Thanks for your help. Everything worked out. The problem was that in the fourth field there should be some value, which is then rewritten with the code from the HTML. I made this field hidden and set the default value - the result was what I wanted to have.

I have a few more questions:

  1. When I try to insert the Publish Date, the value has format: YEAR-MONTH-DAY HOURS:MINUTES:SECONDS. Is it possible in some way to show only YEAR?
  2. If I have a drop-down field, when I use the following function, the item id is returned, but not its contents. How can I display the content, rather than id?
1283 Posts
Bucklash
4 years ago
0
Level 5

Ah the defaultvalue gotcha ;)

re .1

apply the typo you require on date field, then use $cck->getTypo(‘my_field’);

2

not sure what mean but select dynamic can return whatever field you selcey

7 Posts
nichik
4 years ago
1
Level 4

1. I already use a field "date" in format Y-M-D on the page, I need to duplicate the field "date", but in another format: Y. Any ideas?

2. This question is closed. If you want to show the text of dropdown list you should use $cck->getText(‘my_field’); instead of $cck->getValue(‘my_field’);

1283 Posts
Bucklash
4 years ago
0
Level 5

2: yeah sorry, I thought you meant show in the select itself

1:I would create another field with the same storage, and apply date typo 

7 Posts
nichik
4 years ago
0
Level 4

How can I do this? I'm trying, but nothing works...

00 - a have a field called "date" with storage "date". I have values from this field. 

01 - I created a new field "created year" with storage "date"

I think, that "created year" must have values from "date", but it doesn't work...

------------------------------------------------------------------------------------------------------------------------------

7 Posts
nichik
4 years ago
1
Level 2

Hello, i have one more question. Have you ever used this plugin? Highlight plugin I cant use it. It doesn't work! Can you help me?

1283 Posts
Bucklash
4 years ago
0
Level 3

nah, never used it

1283 Posts
Bucklash
4 years ago
1
Level 1

In your content or list/item views you can do 2/typo

The date typo (maybe have to install plugin) allows you to apply date format. can do custom as well - if adding html to custom prefix each character with / or \ (can’t remember which).

7 Posts
nichik
4 years ago
0
Level 2

Thanks for your help. Everything works Perfect now. To solv the problem it is I needed to created field "created_year" locked to the "Article". And thats all. Then I made a typo with needed Date format and $cck->getTypo(‘my_field’); helped me to finish... =) Thank you very mach.

Get a VIP membership