Keyword

K2 different Image and Attatchment Path

  • Alex
  • Alex's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 4 months ago #150553 by Alex
Hi,
In System Configuration -> Media, i set my Path to File: "media/k2/attatchments", where my attatchments are stored.
My images are in "images/". But i only set weather "media/k2" OR "images", since images path has to be subfolder.
Can i configure my system somehow, that when i click browse server in k2 items->images tab, it opens "images" and when i click in k2 items->attatchments, it opens "media/k2/attatchments"?

Please Log in or Create an account to join the conversation.

  • Alex
  • Alex's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 4 months ago #150578 by Alex
Replied by Alex on topic K2 different Image and Attatchment Path
Hi, can someone please help me with these file pathes.

I want to attatch one pdf file and one jpg image to my k2 item.
I upload the pdfs via ftp to the folder "media/k2/attatchments/pdf/en" and u upload the images to "images/k2items".
Now i add one of each in my k2 item using k2 in joomla.

Somehow the pdfs get copyed to "media/k2/attatchments" even i have them already online in the folder above.
And the images gets copyed into "media/k2/items/src". And i think k2 uses them from there.
Why cant k2 use it from my folder, where i choose them?

If i change a pdf local and replace it in my folder "media/k2/attatchments/pdf/en", then i think i wont replaced on the webpace, because it holdes the backup in "media/k2/attatchments".

Guess i have to delate it in my k2 item and add id again.

Cann someone help me to get rid of this?

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #150584 by Lefteris
Replied by Lefteris on topic K2 different Image and Attatchment Path
Hi,

K2 images are always stored under media/k2/items and this cannot be changed.

K2 attachments are stored in the path you set in the K2 parameters in the option "Change root attachments folder" .

The browse server button used in K2 images and attachments is always looking at the path you set System Configuration -> Media . This option is common for every place that media manager is used in K2.

Please Log in or Create an account to join the conversation.

  • Alex
  • Alex's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago - 9 years 3 months ago #150603 by Alex
Replied by Alex on topic K2 different Image and Attatchment Path

Lefteris wrote: The browse server button used in K2 images and attachments is always looking at the path you set System Configuration -> Media . This option is common for every place that media manager is used in K2.


Hi, thank you for your response Lefteris,

my intention is, to upload image and pdf attatchment via ftp. And by time, if i want to change the attatchment, i want to replace the file on the ftp. So that i dont have to remove and add it new in the k2 item interface in joomla. Do you know what i mean?

Does it work, that i save my attatchments in "media/k2/attatchments" and my images in "media/k2/items/src" and it will work like i need?
I doesnt think so, becaus if i use an attatment in different items, they get copyed and renamed wit item id in front of attatchment name.

Someone got a solution for this, or how do i controll the images/attatchmens comfortable?
Last edit: 9 years 3 months ago by Alex.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #150611 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 different Image and Attatchment Path
Hello Alex,

It the filename is the same, then it will work. If on the other hand it is not, then it will work since the reference to the item is not updated.

Please Log in or Create an account to join the conversation.

  • Alex
  • Alex's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 2 months ago #151409 by Alex
Replied by Alex on topic K2 different Image and Attatchment Path

Krikor wrote: Hello Alex,

It the filename is the same, then it will work. If on the other hand it is not, then it will work since the reference to the item is not updated.

Yes, the problem is, i have an item with an attatchment. The attachmend is stored in /media/k2/attatchments. Now i want this same attachment file attatch to another k2 item. K2 then, copys the file and renames it to "filename_14****"".
Isnt it posible, the K2 uses the file, with its name, wich is alread in this attatchment folder?

My intention is: If i do an chance in this attatchment, i could change it offline, replace it with pdf, and all items, with this attatchment are updated.
Is there an solution?

Please Log in or Create an account to join the conversation.

  • Alex
  • Alex's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 2 months ago #151459 by Alex
Replied by Alex on topic K2 different Image and Attatchment Path
Or how is it ment to manage the attatments. How do you guys handl this issue?

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #151470 by Lefteris
Replied by Lefteris on topic K2 different Image and Attatchment Path
@Alex

What you want to achieve cannot be done without hacking K2.

I suggest to use extra fields and link directly to that file instead of using attachments.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #152054 by Odin Mayland
Replied by Odin Mayland on topic K2 different Image and Attatchment Path
I have tried both images/podcasts and /images/podcasts

Neither make the media upload feature to save it in that location.

What should the path be?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152082 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 different Image and Attatchment Path
Jeff are you talking about attachments or media?

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #152113 by Odin Mayland
Replied by Odin Mayland on topic K2 different Image and Attatchment Path
My assumed workflow would be to allow the client to upload the mp3 via the attachment tab which would also serve as a download feature and then when the client goes to the Media tab and clicks "Browse media on server" they would be able to choose that same mp3 file.

The Media:Browse media on server goes to /images

I set the attachment root to be "images/podcasts" but when I upload an attachment it does not appear in "images/podcasts".

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152125 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 different Image and Attatchment Path
Which folder are they uploaded to?

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #152128 by Joe Campbell
Replied by Joe Campbell on topic K2 different Image and Attatchment Path
This is a good example of how providing a "File" Extra Field type would be useful:
github.com/getk2/k2-v3-dev-build/issues/113

Please Log in or Create an account to join the conversation.

  • Alex
  • Alex's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago #152190 by Alex
Replied by Alex on topic K2 different Image and Attatchment Path

Lefteris wrote: @Alex
What you want to achieve cannot be done without hacking K2.
I suggest to use extra fields and link directly to that file instead of using attachments.

Hmm... my Problem is that i already do use the extra fields (listed) at anouter position of the item.php.
I mean, is it a problem that one file could be attatched to different k2 items, as attatchment?
Is there a chance that it comes with k2v3?
I mean, i can imagine, that this is relevant for many people, who want to maintain their website without much effort.
If the attatchment has to be maintained often, the ftp solution would be the easyest one.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #152211 by Odin Mayland
Replied by Odin Mayland on topic K2 different Image and Attatchment Path

Alex wrote:

Lefteris wrote: Hmm... my Problem is that i already do use the extra fields (listed) at anouter position of the item.php.


Correct me if I am wrong but you can position an extrafield wherever you want with this code:
<?php echo $extrafields[XXX];?>
Where XXX is the numerical id of the custom field you want to display.

Please Log in or Create an account to join the conversation.

  • Alex
  • Alex's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago #152242 by Alex
Replied by Alex on topic K2 different Image and Attatchment Path

Jeff Mayland wrote: Correct me if I am wrong but you can position an extrafield wherever you want with this code:

<?php echo $extrafields[XXX];?>
Where XXX is the numerical id of the custom field you want to display.

Hi Jeff,
yes you are of course right. i could do it like this.
But i think this is not a nice solution. Since there is an attatchment field, i would like to use it for attatchments.
And i think many people would like to use it in that way, i told, for easy maintanance.
Coding out one extra field, in the extra field list, and use it as attatchmant, is possible, but not a nice clean solution, in my eys.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #152243 by Odin Mayland
Replied by Odin Mayland on topic K2 different Image and Attatchment Path

Alex wrote:

Jeff Mayland wrote: Coding out one extra field, in the extra field list, and use it as attatchmant, is possible, but not a nice clean solution, in my eys.


I completely agree.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152294 by Krikor Boghossian

Please Log in or Create an account to join the conversation.

  • Alex
  • Alex's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago - 9 years 1 month ago #152418 by Alex
Replied by Alex on topic K2 different Image and Attatchment Path

Krikor wrote: github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L104-L109

You can also use this code.


Okay, i try i like this and got it working.
I choosed extra field "text field". Then the Name is fixed the name of the extra field, i mean i can not change it due a field value. But the value is.
Thankt you very mutch for your help.
Last edit: 9 years 1 month ago by Alex.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152442 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 different Image and Attatchment Path
You 're welcome Alex.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum