Image links in content blocks are broken after saving.. "{CCM:FID_NN}"

Permalink
The images end up with the link "{CCM:FID_NN}".

Anyone any clue?

 
JohntheFish replied on at Permalink Reply
JohntheFish
The content block notes links and images internally using markers of that format, then fills in the links when the content is rendered.

Its all supposed to be done automatically behind the scenes. Seems like something has gone wrong.

Is FID_NN what you actually see? Or is it like FID_23 (or any other digits)?
btnguden replied on at Permalink Reply
Hi John,

Correct, the src links are like "{CCM:FID_9}". In all modes(published, preview, edit mode, logged in out of edit mode)..

Once you edit the content block the link gets retored(/index.php/download_file/view_inline/9/).

Tried doing it in a new block; in a new page; in another template; clearing the cache; different browsers/OS.. :(
btnguden replied on at Permalink Reply
No javascript errors either
JohntheFish replied on at Permalink Reply
JohntheFish
I expect you have already disabled and cleared the c5 cache.

I was thinking maybe the /files location had become disconnected, but that doesn't hold because edit/save corrects the issue.

There was a change in the way those markers were processed in 5.6.3.1. The code used to be directly in the content block, but now it is in a helper.

Have you recently upgraded? Do you have any overrides that could be out of step with the core code? Could this be arising from an incomplete upgrade?
btnguden replied on at Permalink Reply
I guess i found the culprit..

It only seem to occur on a custom block i've added. It's actually just a copy of the normal content block but with a slightly different view.php

I've replaced the part where $content get echoed with
<?php echo $this->controller->getContent($content) ?>
so the replacing actually happens. I guess it works differently on the normal content block behind the curtains.

I did all this to wrap the content of each block in a piece of HTML... :( Selecting presets of styling was something the client didnt want. So i end up with a Content block and a Content block with a background and some padding..

I've tried the wrapping with the setWrapper methods, but this just wraps all the blocks and not each block you add to a area.

Is there a better way to handle this in the future?

Thanks for your time John
JohntheFish replied on at Permalink Reply
JohntheFish
I suspect it is just terminology. The best way to do what you want is with custom block templates, which is what I expect you have already done (you did just create a template and not override the entire block?)
btnguden replied on at Permalink Reply
Actually i did copy the content block, placed it /blocks, and created a new block type of it in the dashboard :) Just for a wrapping div for each block.

I'll go look into the custom block templates next time :)

Thing is, i didn't have enough time to look into every feature and best way to implement things such as these.. Started working for this company a week ago, and this project on which they were working on for months has a deadline next week. The previous dev fled the ship, so i had just a couple days to finish this attempt of making a inhouse CMS, which turned out to be half "finished"..

I took a gamble and migrated everything to concrete5(which is totally new for me), it just took me 3 days.. And even made a couple custom blocks and packages.
This was the last thing bugging so its finished :)

Thnx dude
JohntheFish replied on at Permalink Reply
JohntheFish
There are plenty of docs and howtos on templates, probably more than on anything else (and too much may just confuse).

Here is one specifically about the content block:

http://www.concrete5.org/documentation/how-tos/designers/custom-blo...

Here is a more general one - but bear in mind that its unclear about being able to put a template in the root override rather than the original block's template folder.

http://www.concrete5.org/documentation/how-tos/designers/change-how...
JohntheFish replied on at Permalink Reply
JohntheFish
$content is the raw content loaded from the database.

$this->controller->getContent() will get the raw content and replace the markers in it (I don't think you need to pass $content back)