I wanted to have a custom URL for the pages displayed in edit mode.
Yes, this is possible. You need to change some places in web.config:
<episerver.packaging protectedVirtualPath="~/episerver" />
and
<applicationSettings uiUrl="~/episerver/CMS/" />
and
<virtualPathProviders> entry for ProtectedModules, <add name="ProtectedModules" virtualPath="~/episerver/" />
and all the <location> elements pointing to "episerver...".
Related
I must create new cartridge for integration in BM but I don't want use pipelines. Can I use the controllers for this? If yes, please provide information on how to do this.
.
Yes, you can. You need to create the bm_extensions.xml and add all the actions/entries.
Note: The file mention pipeline but It can actually be a Controller as you can see in the example I linked below.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<extensions xmlns="http://www.demandware.com/xml/bmmodules/2007-12-11"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.demandware.com/xml/bmmodules/2007-12-11 bmext.xsd">
<menuaction id="paypal_transactions_manager" menupath="orders" position="200" site="true">
<name xml:lang="x-default">PayPal Transactions</name>
<short_description xml:lang="x-default">Manage the PayPal transactions related with this site orders.</short_description>
<description xml:lang="x-default">Manage the PayPal transactions related with this site orders.</description>
<exec pipeline="PaypalAdmin" node="Orders" />
<sub-pipelines>
<pipeline name="PaypalAdmin-Orders" />
<pipeline name="PaypalAdmin-OrderTransaction" />
<pipeline name="PaypalAdmin-Action" />
<pipeline name="PaypalAdmin-CreateNewTransaction" />
</sub-pipelines>
<icon>paypalbm/images/icon_transactions.png</icon>
</menuaction>
</extensions>
PayPal Cartridge bm_paypal is a good example to understand how is done: https://github.com/SalesforceCommerceCloud/link_paypal/tree/master/cartridges/bm_paypal/cartridge
Ps: Let me know if you cannot access the link.
In DNN 8, I have 3 (three) different portals, all with the same IA (pages & content). Example: portal1.site.com, portal2.site.com, portal3.site.com.
Using SiteUrl.config, I want to re-write the URL so that a vanity URL that doesn't exist redirects to the correct page. After further investigation, I realized that siteurl.config uses URLs in relative basis. It's not able to comprehend what portal you're coming from.
<RewriterRule>
<LookFor>[^?]*/plan/speakers/.*-(.*)</LookFor>
<SendTo>~/Default.aspx?TabId=180&SpeakerId=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>[^?]*/plan/speakers/.*-(.*)</LookFor>
<SendTo>~/Default.aspx?TabId=144&SpeakerId=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>[^?]*/plan/speakers/.*-(.*)</LookFor>
<SendTo>~/Default.aspx?TabId=264&SpeakerId=$1</SendTo>
</RewriterRule>
If a user wants to go to portal1.site.com/plan/speakers/mike, portal2.site.com/plan/speakers/mike, or portal3.site.com/plan/speakers/mike, they all redirect to tabid 180 (which works only for the second portal).
I was able to implement a workaround.
1. you want to mask a new url using IIS rewrite in the web.config.
<rule name="Redirect to plan" enabled="true" stopProcessing="true">
<match url="^plan/speakers/([_0-9a-z-]+)-([0-9]+)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true">
<add input="{HTTP_HOST}" pattern="^(.*).domain.*" />
</conditions>
<action type="Rewrite" url="/{C:1}/{R:0}" />
</rule>
This will re-write your url to something like this: portal1/plans, portal2/plans, etc.
Then, you want to edit your siteurl.config to account for these re-writes.
<RewriterRule>
<LookFor>[^?]*/portal1/plan/speakers/.*-(.*)</LookFor>
<SendTo>~/Default.aspx?TabId=180&SpeakerId=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>[^?]*/portal2/plan/speakers/.*-(.*)</LookFor>
<SendTo>~/Default.aspx?TabId=144&SpeakerId=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>[^?]*/portal3/plan/speakers/.*-(.*)</LookFor>
<SendTo>~/Default.aspx?TabId=264&SpeakerId=$1</SendTo>
</RewriterRule>
P.S. Make sure too add these urls to the list of to-ignore in your advanced url settings.
I would have done this by adding Records to the TabURLS table for each page. If you modify a Page, using the page settings, you can modify the URL of the page. Try that. Look at the records in the table for that page.
select * from taburls where tabid = ##
Then change the URL back to the original URL
select * from taburls where tabid = ##
See if it adds a new record there. If so, then just copy the format of that "row" in the table for any additional records you need to create.
You might also check out this codeplex project
I know this question may be ridiculous but I could not find the answer. The Post sharp writes the logs in console by System.Diagnostics but I need to write the logs in a separate file. Is there any way to do so?
Thanks in advance
I found also I can do this in the app.config as the following:
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\\log.txt" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
You need to use System.Diagnostics.Trace.Listeners property to register your own listener. You would need code like this in your app's entry point:
using (StreamWriter sw = new StreamWriter("file.txt"))
using (TextWriterTraceListener tl = new TextWriterTraceListener(sw))
{
Trace.Listeners.Add(tl);
try
{
// execute your program here
}
finally
{
Trace.Listeners.Remove(tl);
}
}
I have dotless installed on my website and it's running perfectly on my local machine and on the companys testserver but when deploying on production server it always returns 404 and I can't figure out why.
This is what I've done so far to get it to work:
Added the section
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
Added the mimeMap
<staticContent>
<mimeMap fileExtension=".less" mimeType="text/css" />
</staticContent>
Added the handler
<add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
And added the dotless element
<dotless minifyCss="true" cache="true" />
Did you add the handler at the correct place?
IIS6: under system.web\httpHandlers
IIS7: under system.webServer\handlers
Also make sure you have all less files in place. If you import other less files, all those files must be available. If a file is missing, dotless throws 404.
I am using the Obout Suite in a website.
I have a SuperForm control in which I have inserted some controls like BoundFields or DateFields.
The problem is that when I select a date at the DateField Calendar, the textbox associated doesn't refresh the value of the date.
I have something like:
<obout:SuperForm ID="SuperForm2" runat="server" AutoGenerateInsertButton ="true" AutoGenerateEditButton="false" AutoGenerateDeleteButton="false" AutoGenerateRows="false" DataKeyNames="IdDocumento" DefaultMode="Insert" Width="525" DataSourceID="SqlDataSource2">
<Fields>
<obout:BoundField DataField="DocumentType" HeaderText="Name" FieldSetID="FieldSet1" />
<obout:DateField DataField="OrderDate" HeaderText="Order Date" FieldSetID="FieldSet2" DataFormatString="{0:MM/dd/yyyy}" ApplyFormatInEditMode="true" />
<obout:DateField DataField="RequiredDate" HeaderText="Required Date" FieldSetID="FieldSet2" DataFormatString="{0:MM/dd/yyyy}" ApplyFormatInEditMode="true" />
</Fields>
<FieldSets>
<obout:FieldSetRow>
<obout:FieldSet ID="FieldSet1" />
</obout:FieldSetRow>
<obout:FieldSetRow>
<obout:FieldSet ID="FieldSet2" />
</obout:FieldSetRow>
</FieldSets>
</obout:SuperForm>
The tag prefix is:
<%# Register TagPrefix="obout" Namespace="Obout.SuperForm" Assembly="obout_SuperForm" %>
The "obout_Calendar2_Net.dll" is referenced by the solution.
Am I forgotting something?
Thanks in advance.
Cartojal
Well, finally I found the solution. If you are using .net 4.0, like me.... you must to add the attribute clientIDMode="AutoID" to the section "pages" at the web.config file:
<pages clientIDMode="AutoID">
....
</pages>
This generate the asp.net controls ids like past versions of .net