From time to time I notice that many extensions duplicate certain functionality. For example, many extensions have a page browser. Some of them use page browser provided by pi_list_browseresults function from tslib_pibase class. Examples include mininews, indexed search and tt_news. That function is hard to customize, so almost everyone creates a new page browser.
I came across it again this week. While creating a new extension I had to use a page browser. I have several page browsers already (in comments and some other extensions). But I do not like copying the code. If error exists in the code I will have to update all places where I copied the code.
Next I thought: it would be great if an extension could provide certain functionality to other extensions. For example, if I make a universal page browser, it could be used from any other extension.
There is a very nice principle for designing web sites. It sound likes this: "Do not ask from user more than you really need".
I often remember this principle when I go to download sample chapters of free demos from web sites. Many of them ask for lots of data. Why, for example, they need to know my social security code or phone number? Or why do they need my e-mail if I want to download the sample chapter? Do they want to spam me?
I usually refuse to give such information because I do not see why they need it and how they will use it. I am not paranoid but I do not see a need to give my details to every unfamiliar person or company.
Why am I writing about it here?
Sometimes browsing the web brings something really revolutionary and amazing.
Everyone knows WordPress. Everyone knows how many themes it has.
Today I discovered a web site that uses ExtJS to create a WordPress theme. This is really amazing. ExtJS uses AJAX a lot and this blog too. All articles are loaded using AJAX and side bar uses Outlook-like sliding layout. Looks really unusual. Give it a try.
What do you think about this site and the idea? Will blogs become more dynamic in future? More web 2.0 like?
Today I had an interesting challenge. I had to create a contact form on the Intranet web site. This web site always has Frontend user logged in. I was going to use standard TYPO3 mailform. Typically such form contains fields for user name and e-mail. When I started to create the form, I immediately realized that it will be stupid to ask for this information if user is already logged it. I should find a way to insert this information automatically.
The obvious solution that come to the mind is to make an extension that will modify the form to include Frontend user data. Yes, it is possible.
In July I had a session about personal productivity at TYPO3 user group in Holland. I planned to make video from these slides but I instead I decided another way to share slides. I put them to SlideShare. You can also vote for these slides to participate in the "World Best Presentation Contest' 08".
In the previous article we talked about TYPO3 template functions. I mentioned that substituteMarkerArrayCached is a function that developers should not use. In this article I am going to explain why.
The first two functions substitute marker and marker array. The third substitutes template subpart. The obvious missing function is the one to substitute subpart array.
From time to time I see this question: how to fill RealURL cache with page addresses?
The answer is pretty simple. Make a new "hide in menu" page. Insert Sitemap there. Logout from Backend. Enter that new page address in the browser bar.
Notice that logging out is essential. RealURL will not cache anything if you are logged in to Backend.
This procedure will fill cache with page addresses. But it will not create cached entries for stuff like tt_news. So this tip is good if you have mostly pages.
Firsts, I wanted to write a warning article about the substituteMarkerArrayCached function. But then I understood that article is going to be about template functions in general and warning should be in the different article.
Let's have an overview of TYPO3 templates and functions to handle them.
Templates in TYPO3 are normal HTML files. These files contain special markers that TYPO3 can replace with data. Markers typically are words in CAPS surrounded by three hash marks. For example: ###LINK###.
Here ###LIST### and ###REPEATING### are subpart markers. Extension can get a subpart and replace it as whole. Often it is used for repeating elements of for subparts that should be removed under certain conditions. "begin" and "end" are not necessary but conventional.
###NUMBER### is a single marker.