EXT:tt_news <link> in RSS feed - rss

I'm trying to set up an RSS Feed through tt_news in TYPO3: http://www.familieistzukunft.ch/home/?type=100
The links in the RSS feed are not proper HTML. They turn up like this:
<link http://www.familieistzukunft.ch/details/...80780691f/ - external-link-new-window "Opens external link in new window">Kommentar</link>
I did the template like this:
<content:encoded> <![CDATA[###NEWS_CONTENT###]]> </content:encoded>
So why does the CDATA tag not help? How do I fix this?
This is my TypoScript:
# RSS2
rss2 = PAGE
rss2 {
typeNum = 100
10 >
10 < plugin.tt_news
10.pid_list >
10.pid_list = {$plugin.tt_news.pid_list}
10.singlePid = {$plugin.tt_news.singlePid}
10.defaultCode = XML
10.displayXML.xmlFormat = rss2
#wenn man archivierte News nicht mehr RSSen will
10.archive = -1
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:text/xml
no_cache = 1
xhtml_cleaning = 0
}
}
#RSS 0.91
rss091 = PAGE
rss091 < rss2
rss091 {
typeNum = 101
10.displayXML.xmlFormat = rss091
}
#RDF
rdffeed = PAGE
rdffeed < rss2
rdffeed {
typeNum = 102
10.displayXML.xmlFormat = rdf
#RDF kennt auch Feed-Images
10.displayXML.xmlIcon = fileadmin/images/rdf.gif
}
#Atom
atom1 = PAGE
atom1 < rss2
atom1 {
typeNum = 103
10.displayXML.xmlFormat = atom1
}
page.headerData.110 = HTML
page.headerData.110.value = <link rel="alternate" type="application/rss+xml" title="News" href="http://www.familieistzukunft.ch/index.php?id=32&type=100">

I had the same problem and solved it with the following code:
rss.10.displayXML {
xmlFormat = rss2
content_stdWrap {
stripHtml = 0
htmlSpecialChars = 0
parseFunc < lib.parseFunc_RTE
parseFunc.nonTypoTagStdWrap.encapsLines.nonWrappedTag >
}
}
The idea is the same but use content_stdWrap instead of bodytext_stdWrap. In my case I got problem using htmlSpecialChars.preserveEntities = 1.

It looks, like you are just putting raw content from DB to ###NEWS_CONTENT### marker.
You should use pi_RTEcssText($rawContent); from tslib_pibase class to convert all the raw content to proper HTML.

Related

Typoscript: Override data with typolink

I'm trying to set the canonical url of page. If the individual field (tx_metaseo_canonicalurl) is not set then the url page should be determined by a typolink.
I tried this but it's not working:
30 = TEXT
30 {
data = FIELD:tx_metaseo_canonicalurl
override.typolink = {
parameter.data = TSFE:id
returnLast = url
forceAbsoluteUrl = 1
addQueryString = 1
addQueryString.method = GET
addQueryString.exclude = cHash,backPid
}
override.if.isFalse.field = tx_metaseo_canonicalurl
wrap = <link rel="canonical" href="|" />
required = 1
}
The last 3 lines should be inside the 30 cObj

TYPO3 show content from subpages inlcuding css classes

With the following typoscript I get all content from the subpages on one page:
lib.allPid = COA
lib.allPid {
10 = HMENU
10 {
special = directory
special.value = 2
1 = TMENU
1 {
expAll = 1
NO.doNotShowLink = 1
NO.allStdWrap.field = uid
NO.allStdWrap.wrap = |,
}
2 < .1
}
}
lib.allContent = CONTENT
lib.allContent {
table = tt_content
select {
pidInList.cObject < lib.allPid
leftjoin = pages ON (tt_content.pid = pages.uid)
where = tt_content.colPos = 0
orderBy = pages.sorting ASC
}
}
But its not copying the tt_content wrap defined by the layout selectbox in the content element:
tt_content.stdWrap.innerWrap.cObject.default.20.40 = CASE
tt_content.stdWrap.innerWrap.cObject.default.20.40 {
key.field = layout
1 = TEXT
1.value = tag-1
2 = TEXT
2.value = tag-2
3 = TEXT
3.value = tag-3
4 = TEXT
4.value = tag-4
5 = TEXT
5.value = tag-5
6 = TEXT
6.value = tag-6
7 = TEXT
7.value = tag-7
}
I tried to add the wrap to the lib.allContent element like this, but it didn't work:
lib.allContent.stdWrap.innerWrap.cObject.default.20.40 = CASE
lib.allContent.stdWrap.innerWrap.cObject.default.20.40 {
key.field = layout
1 = TEXT
1.value = tag-1
2 = TEXT
2.value = tag-2
3 = TEXT
3.value = tag-3
4 = TEXT
4.value = tag-4
5 = TEXT
5.value = tag-5
6 = TEXT
6.value = tag-6
7 = TEXT
7.value = tag-7
}
Does anybody know how to do this? Thanks in advance!
EDIT:
I found a solution (or better: workaround) without typoscript. I insert the contents from the subpages with "New content element - Special Elements - Insert Record" manually one by one. Then, everything is copied. This solutions requires a little more user input but fits perfectly to my needs.
give a try to vhs ViewHelper it'll give you exact output what you want I mean default wrap and at all.
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<v:page.menu pageUid="2" includeSpacers="0" resolveExclude="1">
<f:for each="{menu}" as="contentList" iteration="Iteration">
<div id="uid{contentList.uid}" class="inner-page-content-of-pageUid-2">
<v:content.render column="0" pageUid="{contentList.uid}" />
</div>
</f:for>
</v:page.menu>
something more about vhs ViewHelper

After encoding UTF-16, the string is broken if I want to use in iTextSharp

Firstly I am getting some informations from a text file, later these informations are added to pdf files' meta data. In the "Producer" section an error was occured about Turkish characters as ğ, ş. And I solved the problem via using UTF-16 like this:
write.Info.Put(new PdfName("Producer"), new PdfString("Ankara Üniversitesi Hukuk Fakültesi Dergisi (AÜHFD), C.59, S.2, y.2010, s.309-334.", "UTF-16"));
Here is the screenshot:
Then, I am getting all pdf files with foreach loop and reading meta data and insert into SQLite database file. The problem occurs right here. Because when I want to get from pdf file and set to database file UTF-16 encoded string (Producer data), it arises strange characters like this:
I don't understand, why it occurs error.
EDIT: Here is my all codes. The following codes get meta data from text file and insert pdf files' meta meta section:
var articles = Directory.GetFiles(FILE_PATH, "*.pdf");
foreach (var article in articles)
{
var file_name = Path.GetFileName(article);
var read = new PdfReader(article);
var size = read.GetPageSizeWithRotation(1);
var doc = new Document(size);
var write = PdfWriter.GetInstance(doc, new FileStream(TEMP_PATH + file_name, FileMode.Create, FileAccess.Write));
// Article file names like, 1.pdf, 2.pdf, 3.pdf....
// article_meta_data.txt file content like this:
//1#Article 1 Tag Number#Article 1 first - last page number#Article 1 Title#Article 1 Author#Article 1 Subject#Article 1 Keywords
//2#Article 2 Tag Number#Article 2 first - last page number#Article 2 Title#Article 2 Author#Article 2 Subject#Article 2 Keywords
//3#Article 3 Tag Number#Article 3 first - last page number#Article 3 Title#Article 3 Author#Article 3 Subject#Article 3 Keywords
var pdf_file_name = Convert.ToInt32(Path.GetFileNameWithoutExtension(article)) - 1;
var line = File.ReadAllLines(FILE_PATH + #"article_meta_data.txt");
var info = line[pdf_file_name].Split('#');
var producer = Kunye(info); // It returns like: Ankara Üniversitesi Hukuk Fakültesi Dergisi (AÜHFD), C.59, S.2, y.2010, s.309-334.
var keywords = string.IsNullOrEmpty(info[6]) ? "" : info[6];
doc.AddTitle(info[3]);
doc.AddSubject(info[5]);
doc.AddCreator("UzPDF");
doc.AddAuthor(info[4]);
write.Info.Put(new PdfName("Producer"), new PdfString(producer, "UTF-16"));
doc.AddKeywords(keywords);
doc.Open();
var cb = write.DirectContent;
for (var page_number = 1; page_number <= read.NumberOfPages; page_number++)
{
doc.NewPage();
var page = write.GetImportedPage(read, page_number);
cb.AddTemplate(page, 0, 0);
}
doc.Close();
read.Close();
File.Delete(article);
File.Move(TEMP_PATH + file_name, FILE_PATH + file_name);
}
And the following codes get data from files and insert SQLite database file. For database operation, I am using Devart - dotConnect for SQLite.
var files = Directory.GetFiles(FILE_PATH, "*.pdf");
var connection = new Linq2SQLiteDataContext();
TruncateTable(connection);
var i = 1;
foreach (var file in files)
{
var read = new PdfReader(file);
var title = read.Info["Title"].Trim();
var author = read.Info["Author"].Trim();
var producer = read.Info["Producer"].Trim();
var file_name = Path.GetFileName(file)?.Trim();
var subject = read.Info["Subject"].Trim();
var keywords = read.Info["Keywords"].Trim();
var art = new article
{
id = i,
title = (title.Length > 255) ? title.Substring(0, 255) : title,
author = (author.Length > 100) ? author.Substring(0, 100) : author,
producer = (producer.Length > 255) ? producer.Substring(0, 255) : producer,
filename = file_name != null && (file_name.Length > 50) ? file_name.Substring(0, 50) : file_name,
subject = (subject.Length > 50) ? subject.Substring(0, 50) : subject,
keywords = (keywords.Length > 500) ? keywords.Substring(0, 500) : keywords,
createdate = File.GetCreationTime(file),
update = File.GetLastWriteTime(file)
};
connection.articles.InsertOnSubmit(art);
i++;
}
connection.SubmitChanges();
Instead of:
new PdfString(producer, "UTF-16")
Use:
new PdfString(producer, PdfString.TEXT_UNICODE)
UTF-16 is a specific way to store Unicode values but you don't need to worry about that, iText will take care of everything for you.

Calculate Sum of Oracle Apex Tabular Form Cell

There is a column as Amount in my oracle apex tabular form. I need to calculate SUM of all fields under this column while data is being entered and display on a Display only field below the tabular form.
I think this can be done using JavaScript and call that JavaScript at onchange of Amount column.
But I don't know how to calculate SUMof Amountcolumn in my oracle apex tabular form. How could I do this?
Add the following JavaScript code into the Page HTML Header property:
<script type="text/javascript">
function tot_cal()
{
var f5=new Array();
var tol=0;
f5=document.getElementsByName("f05"); /*f05 is Apex array which holds the data*/
for(i=0;i<f5.length;i++){
tol = (tol*1) + (f5[i].value.replace(/,/g, '') * 1);
}
/* alert(tol); */
$s('P10_AMOUNT_VALUE', tol.formatMoney(2,',','.'));
}
Number.prototype.formatMoney = function(decPlaces, thouSeparator, decSeparator) {
var n = this,
decPlaces = isNaN(decPlaces = Math.abs(decPlaces)) ? 2 : decPlaces,
decSeparator = decSeparator == undefined ? "." : decSeparator,
thouSeparator = thouSeparator == undefined ? "," : thouSeparator,
sign = n < 0 ? "-" : "",
i = parseInt(n = Math.abs(+n || 0).toFixed(decPlaces)) + "",
j = (j = i.length) > 3 ? j % 3 : 0;
return sign + (j ? i.substr(0, j) + thouSeparator : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thouSeparator) + (decPlaces ? decSeparator + Math.abs(n - i).toFixed(decPlaces).slice(2) : "");
};
</script>
Tabular Form Element/Element Attributes property of the Amount column:
onchange="tot_cal();"

Drupal Theming: Omega drupal .info file?

I'm using an Omega child theme. I've renamed and renamed all the functions. I'm a bit of a newbie at drupal but a very experienced wordpress user. I'm a bit frustrated by the theme configurations.
I'm trying to use the .info file to override the columns and the layout. Whenever i change the number of columns it doesn't actually render the columns. I've cleared the cache as well. Unfortunately, the settings i've set in the Administration-> Theme -> Theme Configurations Page Override my .info file.
Any ideas?
The following is my .info file for my theme
; $Id: childtheme.info,v 1.1.2.15
; ------- Declare default theme information
name = Child Theme
description = Child Theme built by Globe Runner SEO
screenshot = screenshot.png
core = 6.x
base theme = omega
; ------- Declare default stylesheets
stylesheets[all][] = assets/css/common.css
stylesheets[all][] = assets/css/custom.css
; ------- Declare default javascript includes
scripts[] = assets/js/core.js
; ------- Declare default theme regions
regions[sidebar_first] = sidebar first
regions[sidebar_last] = sidebar last
regions[header_nav] = header nav
;regions[header_last] = header last
regions[preface_first] = preface first
regions[preface_middle] = preface middle
regions[preface_last] = preface last
regions[content_top] = content top
regions[content_bottom] = content bottom
regions[postscript_one] = postscript 1
regions[postscript_two] = postscript 2
regions[postscript_three] = postscript 3
regions[postscript_four] = postscript 4
regions[footer_first] = footer first
regions[footer_last] = footer last
regions[meta_first] = meta first
regions[meta_last] = meta last
; ------- Declare default theme features
features[] = logo
features[] = name
features[] = slogan
features[] = mission
features[] = node_user_picture
features[] = comment_user_picture
features[] = search
features[] = favicon
features[] = primary_links
features[] = secondary_links
; ------- Set the default settings to be used in theme-settings.php
; ------- Non-960gs general settings
settings[reset_css] = 1
settings[text_css] = 1
settings[regions_css] = 1
settings[defaults_css] = 1
settings[custom_css] = 1
settings[front_page_title_display] = title_slogan
settings[page_title_display_custom] = ''
settings[other_page_title_display] = ptitle_stitle
settings[other_page_title_display_custom] = ''
settings[configurable_separator] = ' | '
settings[omega_breadcrumb] = 'yes'
settings[omega_breadcrumb_separator] = ' / '
settings[omega_breadcrumb_home] = 1
settings[omega_breadcrumb_trailing] = 1
settings[omega_breadcrumb_title] = 1
settings[mission_statement_pages] = home
settings[sidebar_combine] = 1
settings[sidebar_contain_pages] = ''
; ------- / Non-960gs general settings
; ------- 960gs default region settings
; ------- default_container_width applies to regions like $help, $messages
settings[omega_default_container_width] = 24
; ------- Region settings for top zone (logo, menus)
settings[omega_branding_wrapper_width] = 24
settings[omega_header_logo_width] = 4
settings[omega_header_menu_width] = 12
; ------- Region settings for header regions
settings[omega_header_wrapper_width] = 24
settings[omega_header_nav_width] = 24
;settings[omega_header_last_width] = 8
; ------- Region settings for default breadcrumb and search box placement
settings[omega_internal_nav_wrapper_width] = 24
settings[omega_breadcrumb_slogan_width] = 10
settings[omega_search_width] = 6
; ------- Region settings for preface regions
;settings[txi_preface_wrapper_grids] = 24
;settings[omega_preface_first_width] = 12
;settings[omega_preface_first_prefix] = 0
;settings[omega_preface_first_suffix] = 0
;settings[omega_preface_middle_width] = 12
;settings[omega_preface_middle_prefix] = 0
;settings[omega_preface_middle_suffix] = 0
;settings[omega_preface_last_width] = 0
;settings[omega_preface_last_prefix] = 0
;settings[omega_preface_last_suffix] = 0
; ------- Region settings for content regions
settings[omega_content_layout] = first_content_last
settings[omega_content_container_width] = 24
settings[omega_sidebar_first_width] = 6
settings[omega_content_main_width] = 17
settings[omega_sidebar_last_width] = 0
; ------- Region settings for postscript regions
settings[omega_postscript_container_width] = 24
settings[omega_postscript_one_width] = 12
settings[omega_postscript_one_prefix] = 0
settings[omega_postscript_one_suffix] = 0
settings[omega_postscript_two_width] = 6
settings[omega_postscript_two_prefix] = 0
settings[omega_postscript_two_suffix] = 0
settings[omega_postscript_three_width] = 4
settings[omega_postscript_three_prefix] = 0
settings[omega_postscript_three_suffix] = 0
settings[omega_postscript_four_width] = 4
settings[omega_postscript_four_prefix] = 0
settings[omega_postscript_four_suffix] = 0
; ------- Region settings for footer regions
settings[omega_footer_container_width] = 24
settings[omega_footer_first_width] = 5
settings[omega_footer_last_width] = 19
; ------- / 960gs default region settings
; Information added by drupal.org packaging script on 2010-07-22
version = "6.x-1.0-beta11"
core = "6.x"
project = "omega"
datestamp = "1279809608"
It's probably because of this code in your theme-settings.php file:
// Get the default values from the .info file.
if (count($subtheme_defaults) > 0) {
// Allow a subtheme to override the default values.
$settings = array_merge($subtheme_defaults, $saved_settings);
}
else {
// Merge the saved variables and their default values.
$defaults = omega_theme_get_default_settings('omega');
$settings = array_merge($defaults, $saved_settings);
}
and the fact that you've saved your settings on the admin/build/themes/settings/omega page.
You'll probably have to delete the relevant settings from the variables table in your database in order for the settings in the .info file to take affect.
I did a little more research into this after posting the above and found the following issue, which offers a better fix for your problem: http://drupal.org/node/795180
Solved. The issue was that you have to reset the default theme values.
This can be accomplished by visiting configuring your own theme:
/admin/build/themes/settings/
Clear the database settings for your theme by clicking "Reset to Defaults"
Thanks #oadaeh !

Resources