Tuszu VIP
Total posts: 128
13 Сен 2013 03:56

Hi!

I want to modification source code in gallery field to change the display of images on the website. But I can't find some piece of code.

1) I want to display image without change the size of image. I need to remove a piece of code responsible for changing the image size.

How to do this? Where is implemented function - resize?

2) I want to delete popup gallery from image. Where is the right piece of code?

How do these two changes in the easiest way?

Thanks in advance!

Последние изменения: 02 Март 2014


Sergey
Total posts: 13,748
13 Сен 2013 08:58

What you need to do is simple create new field output template. And there do

foreach($this->value AS $file)

{

var_dump($file);

}

And you will see the values. There is realpath value which you can use to create image source URL.


Tuszu VIP
Total posts: 128
13 Сен 2013 21:40

@Sergey, I want to change existing code in files like gallery.php, full.php, list-simple-one.php etc.

And I would be glad and really grateful for show me a particular piece of code.

Thanks in advance!


Sergey
Total posts: 13,748
15 Сен 2013 02:19

Please first read about fields templates concept.

http://docs.mintjoomla.com/en/cobalt/custom-templates-fields/ .

You have to make template copy first.

Then delete all PHP and place only these lines there.

$path = JUri::root(true).'/'.JComponentHelper::getParams('com_cobalt')->get('general_upload').'/'.$this->params->get('params.subfolder', $this->field_type).'/';

foreach($this->value AS $file) 

{ 

     echo '<img src="'.$path.$file['fullpath'].'">';

} 

Tuszu VIP
Total posts: 128
16 Сен 2013 03:17

Thanks a lot for Your helping! It's work! :D

I want to change one little thing...

What to add to the above code, when user click on an image, user have been moved to a specific entry?

Just like user click on title entry.


Sergey
Total posts: 13,748
16 Сен 2013 08:05

echo '';


Tuszu VIP
Total posts: 128
17 Сен 2013 08:26

I mean dynamic code like in title entry.

How to prepare in php code to move user to specific entry?

I can not add the code permanently, because each entry is a different url generated by the title.


Sergey
Total posts: 13,748
17 Сен 2013 08:33

Tell me what is specific entry? It is article full view or what?


Tuszu VIP
Total posts: 128
18 Сен 2013 08:04

Yep, exactly. This is full view entry.

I want to accomplish the same thing by clicking on the title.


Sergey
Total posts: 13,748
19 Сен 2013 00:23

echo '';


Tuszu VIP
Total posts: 128
21 Сен 2013 16:14

Thanks a lot Sergey!

You're the best! :D

Работает на Cobalt