Montag, 10. August 2009

ContentXXL Suche funktioniert nicht - search does not work

Wenn Sie das Problem haben, dass das Suchmodul nicht korrekt funktioniert im ContentXXL, dann kann es an Datenbankeinstellungen liegen. Bei jedem Suchbegriff gibt er immer eine "no results" Ausgabe an. Dann bitte den "Volltextindex" bei den Tabellen aktivieren, welche durchsucht werden sollen.

If you have the problem, that the search-module in ContentXXL does not work properly, then there reason for that could be database settings. If every keyword outputs the "no result" page, then please check the "fulltextindex" in your SQL db on the tables, where the search result will happen.

Freitag, 7. August 2009

Events im Page_Load abfangen - catch events in page_load

Manchmal könnte man einige Informationen einen Events schon im Page_Load benötigen. Hierzu kann man folgenden Code verwenden, damit dies funktioniert.

Sometimes you might need information of an event in the Page_Load. You can use this code to achieve this:

Page_Init
MyButton.OnClientClick = GetPostBackEventReference(MyButton);
Page_Load
string eventTarget = Request["__EVENTTARGET"];
if (!string.IsNullOrEmpty(eventTarget))
{
string[] arrNameParts = eventTarget.Split(Convert.ToChar("$"));
string strButtonName = arrNameParts[arrNameParts.Length - 1];
if(strButtonName == "MyButton")
Response.Write("Works");
MyButton_Click(null,null);
}

Der MyButton_Click event wird dann ausführen, was zu dem Button-Click gehört und somit wurde im Page_Load bereits verarbeitet.

The MyButton_Click event will then raise, what means, that the button-click already happend in Page_Load.

Donnerstag, 6. August 2009

Caching und Tracking - caching and tracking

Manchmal taucht das Problem auf, dass man gerne Seiten, welche gecached werden tracken will. Problem ist, wie kommt man an die Mischung aus gecachedten und aktuellen Daten?
Hier habe ich den Workaround wie folgt erledigt.
Per Javascript werden für die Seite relevante und gecachedte Daten als Querystring an die URL eines Imagefiles angehängt, welches allerdings auf eine aspx oder php oder jsp Seite verweist. In dieser (bei jedem Aufruf trotz Cache) Seite werden dann aktuelle Daten und Datenbankeintrag ausgeführt sowie Daten aus dem Querystring übernommen. Im Grunde ist es ein IFrame per Imagetag.

Sometimes you might have the problem, that you want to track cached pages. The issue is, how do you get to the mix of cached and runtime data?
I used a kind of work-around to achieve this.
Via javascript you get to the cached (for each tracking item equal) data in the page and then you add those as a query-string to the URL of an image-file that has been added and pointing to a aspx, php or jsp file. In this file you can access the database and enter all runtime data and the query-string data. Basically it is a kind of Iframe made with an image-tag.

<img src="myFile/Log.aspx" border="0" height="1" width="1" />


Im Log.aspx werden dann alle Daten in die Datenbank abgefüllt inkl. Datum, welches dort aktuell ist. Dieser Imagetag kann in jede gechachedte Seite eingefügt werden.

The Log.aspx then runs the database insert with current datetime included, which will be always the runtime one. This image-tag can be inserted to any cached page.

WICHTIG! Kein javascript Datum übergeben, denn dann bekommt man die Clientrechnerzeit, welche durch individuelle Einstellung und Zeitzone stark variiert.
IMPORTANT! Do not enter the javascript datetime, because then you get the client-time, that can differ because of individual settings and time-zones.

margin: 0pt auto; funktioniert nicht - does not work

Sie haben ein Problem, dass der CSS Befehl margin: 0pt auto; beim Internet Explorer nicht funktioniert? Egal wie man es anstellt, es will einfach den Layer nicht zentrieren. Das liegt an der Formatierung der kompletten HTML Seite. Hierzu bitte folgendes ändern. Standard <html> Tag ersetzen durch:
<?xml version="1.0" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="de" xml:lang="de" xmlns="http://www.w3.org/1999/xhtml">


You have a problem with the CSS coding margin: 0pt auto; in Internet Explorer? No matter what you do, it won't center your layer. The reason for this might be the format of the whole HTML template. Just replace the basic <html> tag with:
<?xml version="1.0" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="de" xml:lang="de" xmlns="http://www.w3.org/1999/xhtml">

Dienstag, 4. August 2009

Doppelter Content - Double content

Ein eigenartiger Fehler machte mir ein paar Stunden zu schaffen. Hierbei wurde bei einer Navigation ein Item doppelt angezeigt, ohne dass dieser im Quellcode ersichtlich war. Er wurde nur vom Internet Explorer verdoppelt und dann auch nur, wenn man aus dem ContentXXL ausgeloggt war. Grund hierfür ist die Standardeinstellung der HTML Definition in ContentXXL. Hierbei unter Portalsettings bei Angepasster Doctype diesen individuell einstellen mit <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">. Danach funktionierte alles tadellos.

I had a strange error that I had to spent some time on. One item in my navigation got displayed twice without appearing in the source-code. It was just displayed when using Internet Explorer and when being logged off ContentXXL. Reason for this error is the standard definition of HTML in ContentXXL. To avoid this error, you need to set the Doctype in the portal-settings individually to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">. Then it works.