View more context

 

Rathai

https://silverstripe-users.slack.com/archives/C36U3BDHN/p1556916096089100 Thanks. This is sorted out.

Show 1 attachment(s)
Rathai

Can anyone guide on this? I enabled template plugin in tinymce... please let me know how to link my templates...

Hide attachment content
Bjorn Bojumble

@Firesphere yeah ZipArchive does the trick too. Its more about getting the system path to the file Im adding. Ended up doing this:

Bjorn Bojumble
  1. if ($zip->open($filePath, ZipArchive::CREATE) === true) {
  2. foreach ($files as $file) {
  3.  
  4. if ($file && $file->File->exists()) {
  5. $file->publishFile();
  6. $filePath = PUBLIC_PATH . '/' . $file->File->getSourceURL(true);
  7. $zip->addFile($filePath, $file->Name);
  8. }
  9. }
  10. }
Firesphere

Ow, yah, either published or granted. I've run in to that too 😕

Firesphere

get URL gives a public URL which may or may not exist 😕

Bjorn Bojumble

getSourceURL(true) will grant, so Im doing it twice above. ammended

Nightcrawler

Is there a way to use the hook into the link functionality triggered by TinyMCE "Page on this site" and "Link to external URL"?

I need a picker for a simple varchar field. I'd assume this is part of SS new React implementation? I've never used that... did someone did something like that?

(I don't want the links as DataObject like e.g. gorriecoe/silverstripe-link)