Template Mod - Doesn't always apply

Steve F

Well-known member
I know why it doesn't apply, what I need is a solution :)

Find:
Code:
<div class="breadBoxBottom"><xen:include template="breadcrumb" /></div>
            </xen:hook>

Seems pretty straight forward but I guess since there are many custom styles and even being a 'space' off will make the template mod not apply. So I'm assuming I need to use regular expression which I'm not certain how to do. Either way I need to insert my template mod at that point. What are my options? I have two add-ons I need to touch up and this is basically the final step for me before releasing.

Any help?

Thanks
 
I know why it doesn't apply, what I need is a solution :)

Find:
Code:
\<div class="breadBoxBottom"><xen:include template="breadcrumb" /></div>
            </xen:hook>

Seems pretty straight forward but I guess since there are many custom styles and even being a 'space' off will make the template mod not apply. So I'm assuming I need to use regular expression which I'm not certain how to do. Either way I need to insert my template mod at that point. What are my options? I have two add-ons I need to touch up and this is basically the final step for me before releasing.

Any help?

Thanks

Search Type:
Code:
 *Regular expression
Find:
Code:
#\<div class="breadBoxBottom">(?:[^>]+>){2}[^\<]+\</xen:hook>#siu

Replace:
Code:
\0
<yourstuff_here>
 
Last edited:
Thank You @EQnoble will test it out. :)

I've seen a few links on the net that explain somethings with regular expression but it wasn't so user friendly to me, any ideas where I could get a better grasp on the subject?

Thanks again!
 
PAGE_CONTAINER
Why can't you use simple replacement to search for:

Code:
<div class="breadBoxBottom"><xen:include template="breadcrumb" /></div>

and replace with

Code:
<div class="breadBoxBottom"><xen:include template="breadcrumb" /></div> <anything else>
 
Why can't you use simple replacement to search for:

Code:
<div class="breadBoxBottom"><xen:include template="breadcrumb" /></div>

and replace with

Code:
<div class="breadBoxBottom"><xen:include template="breadcrumb" /></div> <anything else>

Well testing on a few styles that we have that have modified page_container does not apply the template mod. I could try inside the <hook> I suppose but I just thought regular expression would be better in most circumstances.
 
Well testing on a few styles that we have that have modified page_container does not apply the template mod. I could try inside the <hook> I suppose but I just thought regular expression would be better in most circumstances.

Oh yeah, that's true. different styles can change the spacing or formatting of the searched string. For me i just test this on the default theme. good point.
 
Well I need assistance again with some regex, hope @EQnoble can point me in the correct direction.

I need to find this for starters, default moderator_bar link.

Code:
<a href="admin.php" class="acp adminLink"><span class="itemLabel">{xen:phrase admin_control_panel_short}</span></a>

But also, the reason I'm back, is we modify that line in our framework and the add-on I am working on is not applying the template mod. Here is the line from our framework, can the above and below have the same regex replacement?

Code:
<a href="admin.php" class="acp adminLink"><span class="itemLabel"><xen:if is="@xb_fa_modBar"><i class="fa fa-cog fa-lg" title="{xen:phrase admin_control_panel_short}"></i><xen:else />{xen:phrase admin_control_panel_short}</xen:if></span></a>

I need to find the that line and be able to essentially replace it with my own.
 
Well I need assistance again with some regex, hope @EQnoble can point me in the correct direction.

I need to find this for starters, default moderator_bar link.

Code:
<a href="admin.php" class="acp adminLink"><span class="itemLabel">{xen:phrase admin_control_panel_short}</span></a>

But also, the reason I'm back, is we modify that line in our framework and the add-on I am working on is not applying the template mod. Here is the line from our framework, can the above and below have the same regex replacement?

Code:
<a href="admin.php" class="acp adminLink"><span class="itemLabel"><xen:if is="@xb_fa_modBar"><i class="fa fa-cog fa-lg" title="{xen:phrase admin_control_panel_short}"></i><xen:else />{xen:phrase admin_control_panel_short}</xen:if></span></a>

I need to find the that line and be able to essentially replace it with my own.
First off, I am completely out of my mind so while I can give you direction...correct is not the exact adjective I would be inclined to select in application to the heading. That said I think I am understanding you correctly...I hope maybe you can clarify this for me.

In the most basic of summarization I would say that you want a single expression capable of catching both of those code blocks?

If so try this...
Code:
#<a[^>]+adminLink"><span class="itemLabel">(?:\{xen:phrase admin_control_panel_short}|<xen:if is(?:(?:.*?(?!</xen:if>?)).)(?:</xen:if>))</span></a>#siu
 
Last edited:
Back
Top Bottom