uSync-Legacy icon indicating copy to clipboard operation
uSync-Legacy copied to clipboard

Macro with Content Parameter

Open roend83 opened this issue 9 years ago • 2 comments

I have created a custom macro with a content parameter. uSync does not appear to try to translate the content ID when syncing the data to another database. Is this a bug or is this not supported?

roend83 avatar Dec 01 '16 04:12 roend83

Hi - yeah lets call it a feature :)

uSync doesn't do mapping of the content ids within the macro parameters (at the moment) :(

KevinJump avatar Dec 01 '16 09:12 KevinJump

this in theory is fixable, it just needs someone who is much clever than me at reg ex to solve.

a typical entry might look like:

 <p>Some <a data-id="1062" href="/{localLink:1062}" title="Somethings">Content </a>here</p>
<p> </p>
<?UMBRACO_MACRO macroAlias="ImageMacroThingy" Image="1058,1059" Contents="1062" />

the mapping config for rich text exitors uses the following regex (its in usyncCore.config)

((?&lt;=localLink:)([0-9]+)|(?&lt;=data-id=&quot;)([0-9]+))

this will match the link (and any images) embedded in the rte but not the macro, so it needs to include some reg ext to find the MACRO markup and extract the numbers (or string of numbers) from any parameters that might be in there.

sadly i don't think thats within my regex skillz

KevinJump avatar Feb 10 '17 17:02 KevinJump