How is it going everyone?
I did a search on the forum and there is no answer to my findings.
I think it will be better if I am explaining what I am doing, just so we get a clearer sense of what I am trying to achieve.
So I am using Sourcerer with article page (com_content), which also utilizes by JReviews extension. JReviews take advantage of Joomla's com_content so well, all com_content's content plugins should work with JReview effortlessly. JReview is essentially a listing/directory extensions, so every listing is actually displayed in article page.
For every listing page, i am making a badge image that display its source codes, with a href and img src, and by the anchor will have dynamic link for each listing, which processed by JReviews.
To illustrate, look below:
Click for full size -
Uploaded with plasq's Skitch
or more familiar badging solution would be Blogger's or ATAAW-like badges:
Click for full size -
Uploaded with plasq's Skitch
So I got everything worked out okay, except for dynamic URL. So again, since JReview is using article page, so I could use syntax directly in JReview detail.thtml files. So here is my code used to achieve below screenshots:
{source 0} [[div style="margin: 0 auto;font-size:10px;font-family:helvetica neue,helvetica,arial,serif;"]][[textarea rows="10" cols="20"]]<a href="[[?php echo '$Routes->content('',$listing,'','',false)'; ?]]" target="_blank"><img src="/images/stories/heart_shadow.png" border="0" alt="curve" style="width: 150px; height: 90px;" /></a>[[/textarea]][[/div]]{/source}
Click for full size -
Uploaded with plasq's Skitch
If you look at the above screenshot, we could see that all parts inside Sourcerer worked out, except for PHP. I have break down each function just so you see more clearly.
{Source 0} = it display the code just like the badges I am imitating.
[[div style]] = font was resized etc.
[[textarea]] = the box width x height.
[?php ?] = doesn't translate the dynamic URL. Instead, it gives Sourcerer Comment Errors.
the PHP code below, if used anywhere outside Sourcerer syntax, will generate the dynamic URL I meant:
<?php echo $Routes->content('',$listing,'','',false);?>
Click for full size -
Uploaded with plasq's Skitch
So like I illustrated above, all codes work within Sourcerer syntax, except for that PHP (it worked if I write echo 'this', but obviously the reason why we are using Sourcerer is to get those function to "read" & "publish" PHP).
To make complete sense of what I am trying to achieve, so on each of every listing (with its own url; like /listing-1.html, /listing-2.html etc.), that have badge that display its source, and for every each anchor that it shows, supposed to be unique and displayed accordingly to the URL of the listing.
Sorry for the long post and if I am not making much sense (pardon my noobness, I have no proper knowledge of codes and programs. Most of my experience are solely experimenting and trial & error). Thank you very much for your time and concern for this. Please advise.
ps: I wish I could be more clearer and you guys get what I am saying. Let me know if I need to explain further. Many thanks again.