We are currently using URL rewrites to replace images and links. But we would like to replace some text contained within a tag. Has anyone achieved this before?
I did try to add a custom tag
<customTags>
<tags name="span">
<tag name="span" attribute="" />
</tags>
</customTags>
But wasn't sure what to add as the attribute if its just the text?
You cannot, as IIS URL Rewrite is only designed for URL rewrite.
If you do want to post-process requests, write a HttpModule or IIS module, and hook to the relevant events,
http://www.iis.net/learn/get-started/introduction-to-iis/iis-modules-overview
Related
I've found this line of code to embed custom css in my custom BE module extension.
<f:asset.css identifier="myextcss" href="EXT:myExt/Resources/Public/Css/myext.css" />
This works fine. But the browser caches this file - how do I prevent it from this? I know, that pages can be set non-cache in FE. But in BE I want only this file prevented from caching, not the whole module.
after some trying I found a workaround.
I add these lines to my controller
$mytoken = substr (str_shuffle($_GET['token']),0,8);
$this->view->assign('mytoken', $mytoken);
And this to my fluid:
<f:asset.css identifier="myextcss" href="EXT:myExt/Resources/Public/Css/myext.css?{mytoken}" />
So the browser find always a "new" file request and reload it.
I have two static html files, one is a design for a homepage, the other is a design for a regular page.
I have a rules to determine which one to use, like this:
<rules css:if-content="body.section-front-page">
<theme href="home.html" />
</rules>
<rules css:if-not-content="body.section-front-page"
css:if-content=".portaltype-document">
<theme href="index.html" />
</rules>
Though I am realizing now that these two pages have common elements, such as the header.
Is there a way to use the header from one page or something, that means if I make changes to the htmlt, it only needs to be done in one place? Another way of asking, can you mix together design files?
You would need to have just the one theme file to do that.
If you design the theme file properly and you do have common elements between the home page and the other site page templates this should be quite possible.
I guess the design is key here... the following site uses one theme file but has a very different home page using rules similar to your css:if-content="body.section-front-page" to determine not to show the left and right columns for example.
http://www.lotterywest.wa.gov.au/
This is not possible.
Diazo (version 1.0.4-py2.7) simply loads the theme file (see diazo.rules.expand_theme(element, theme_doc, absolute_prefix)). The loaded file must have a etree.parse()able format and AFIK there are no "rules" to embed or include further files or code.
I've been trying to find a workaround with no success until now. My alternative idea was to include the common code as a replace rule and then apply the other rules. E.g. have a given id in your theme-file and expanding it with a diazo rule. This works only if you do not need to expand your code (see my question https://stackoverflow.com/q/21703070/1659599).
If you only nedd to add html text without further replacements then you could add this by a rule.
I am attempting to move legacy content into Umbraco v4.9.1. Some of the photos that are being migrated are being resized using an httphandler (ImageResizer.ashx) using variables passed through the query. When I attempt to save the path the url is replaced with either "/" or what the path originally was. Is there a work around? The tag is below.
<img src="/imageresizer.ashx?mw=232&src=/imagePath/image.jpg" />
The url is correct, because if I type it into a browser the image comes up fine. It seems like Umbraco is filtering out this url.
UPDATE:
I am noticing that the editor is chopping off everything before /imagePath/image.jpg and only displaying that. I have tried turning off the TidyEditorContent in the UmbracoSettings.config and it still does this.
A workaround would be to UrlEncode the src part of these Urls, where "/" is replaced by "%2F".
<img src="/imageresizer.ashx?mw=232&src=%2FimagePath%2Fimage.jpg" />
I don't know if you can do this is your particular situation, but it is a workaround.
I am having many xhtml files in several folders. I want to rewrite the url as
from http://localhost:8080/folder1/file1.seam to http://localhost:8080/folder1/file1
In file1.page.xml I gave
<rewrite pattern="/folder1/file1" />
The above provided me with the correct pattern. But i have many files and i don't want to specify this rewrite pattern in every page.xml file. Is there any way to specify this in pages.xml?
EDIT:
http://localhost:8080/folder2/file2.seam to http://localhost:8080/folder2/file2
http://localhost:8080/folder3/file3.seam to http://localhost:8080/folder3/file3
More samples of my translation
Rewriting occurs based on rewrite
patterns found for views in pages.xml
Seam URL rewriting does both incoming
and outgoing URL rewriting based on
the same pattern
Example:
<page view-id="/home.xhtml">
<rewrite pattern="/home" />
</page>
any incoming request for /home will be sent to /home.xhtml
any link generated that would normally point to /home.seam will instead be rewritten as /home
Rewrite patterns only match the portion of the URL before the query parameters
Both these will be matched
/home.seam?conversationId=13
/home.seam?color=red
Rewrite rules can take these query paramters into
consideration
<page view-id="/home.xhtml">
<rewrite pattern="/home/{color}" />
<rewrite pattern="/home" />
</page>
Incoming request for /home/red will be served as if it were a request for
/home.seam?color=red
If color is a page parameter an outgoing URLr /home.seam?color=blue would output as
/home/blue
Remember:
Rules are processed in order
List more specific rules before more general rules
If you want to hide the conversation id, you can do like this:
<page view-id="/search.xhtml">
<rewrite pattern="/search-{conversationId}" />
<rewrite pattern="/search" />
</page>
Now /search.seam?conversationId=16would be written as /search-16
If you want to match multiple pages use wildcards
<page login-required="true" view-id="/admin/*">
Hope this helps
Update
To answer your update question.
You can create wildcard rewriting with external rewriting but not with Seam's URL rewriting. With the view-based rewriting you would need to declare a pattern for each view id as you have described your self.
Sorry, but that just the way the cookie crumbles. :-)
yes, there is. Look at here.
how can make all anchor tag and image tag in master and detail pages (asp.net) fully qualified url?
for example: http://example.com/path/file.aspx
Im using url rewriting and want all my path be fully qualified.
plz write your code.
use like below
sample
The only way I'm aware of to catch both server control output and standard HTML output is to rewrite the handler output on the fly. I wrote an HttpModule a long time ago that rewrites handler output to fully qualified URLs (<a href="../foo.gif"> to <a href="http://yoursite/images/foo.gif">) for use with FeedBurner. You may be able to take that code and adapt it for your needs.
Note that there may be a performance impact if you take this approach and you will want to ensure that's acceptable.