TYPO3 show content from subpages inlcuding css classes - css

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

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

Align Image inside cell to the right doesn't work

I need to align on the headers an image to the right. This is my code:
Section section = document.AddSection();
table = section.Headers.Primary.AddTable();
var column = table.AddColumn("5cm");
column.Format.Alignment = ParagraphAlignment.Left;
column = table.AddColumn("8cm");
column.Format.Alignment = ParagraphAlignment.Left;
column = table.AddColumn("4cm");
column.Format.Alignment = ParagraphAlignment.Right;
eRow.Cells[0].AddParagraph("Some text");
eRow.Cells[1].AddParagraph("Some text");
eRow.Cells[2].Format.Alignment = ParagraphAlignment.Right;
image = eRow.Cells[2].Elements.AddImage(imagePath);
image.LockAspectRatio = false;
image.Width = Unit.FromInch(0.16);
image.Height = Unit.FromInch(0.09);
image.RelativeVertical = RelativeVertical.Line;
image.RelativeHorizontal = RelativeHorizontal.Margin;
image.Top = ShapePosition.Top;
image.Left = ShapePosition.Right;
image.WrapFormat.Style = WrapStyle.Through;
But it's always to the left, any help please?
I know it is a bit late
But you have to wrap your image in a paragraph.
http://forum.pdfsharp.net/viewtopic.php?f=2&t=158
Something like (I use parts of your code)
Section section = document.AddSection();
table = section.Headers.Primary.AddTable();
var column = table.AddColumn("5cm");
//I assume eRow is just a row added to your table
var eRow = table.AddRow();
var paragraph = eRow.Cells[0].AddParagraph();
//set the alignment on the paragraph object
paragraph.Format.Alignment = ParagraphAlignment.Right;
paragraph.AddImage(imagePath);
I had the same problem at it worked with the code/link from above.
The lines
image.RelativeVertical = RelativeVertical.Line;
image.RelativeHorizontal = RelativeHorizontal.Margin;
image.Top = ShapePosition.Top;
image.Left = ShapePosition.Right;
image.WrapFormat.Style = WrapStyle.Through;
logically take the image out of the cell. This creates an image that can appear anywhere on the page, not just inside the cell.
Maybe it works if you simply remove those five lines. Maybe it works if you add a Paragraph to the Cell and add the Image to the cell.
If you would have supplied an MCVE I would have tried if my suggestions work. But you only show a code snippet.
The line image.LockAspectRatio = false; is superfluous, but does no harm.
It will work if you do like that:
row.Cells[1].AddParagraph().AddImage(fileName);
row.Cells[1].Format.Alignment = ParagraphAlignment.Right;

Text of the label not displayed in browser

i have assigned the value to the label from data table ,the value of label is shown when i checked using break point.But it not shown in the browser
if(loadingHubArrivalTable.Rows.Count > 0 && dt != Convert.ToDateTime("1900-01-01"))
{
//ReferenceLabel.Text = loadingHubArrivalAdapter.SelectReferenceNumber(Convert.ToInt32(VehicleDropDownList.SelectedValue)).ToString();
ReferenceLabel.Text = loadingHubArrivalTable.Rows[0]["ReferenceNumber"].ToString();
VehicleNumberLabel.Text = VehicleDropDownList.SelectedItem.Text;
//loadingHubArrivalTable.Rows[0]["VehicleNumber"].ToString();
ObjectDataSource1.Select();
CheckBoxList.DataBind();
}

How to render content in a custom typo3 grid element ?

I'm trying to make a simple 2 column teaser element that displays an image on the left column, a content element in the right column plus a button link.
This is the original ts, it works but it's ugly and the images are static:
tt_content.gridelements_pi1.20.10.setup {
29 < lib.gridelements.defaultGridSetup
29 {
columns {
20 < .default
20.outerWrap = <div class="fifty1"><div class="csc-textpic csc-textpic-intext-left-nowrap"><div class="csc-textpic-imagewrap"><img src="{field:flexform_teaserimage1}" alt="" /></div></div><div class="fiftycontent"><div class="csc-textpic csc-textpic-text">|</div></div><div class="fiftylink"><img src="{$tmplpath}images/button.png" alt="" /></div></div>
20.insertData = 1
}
}
}
This is the new ts I'm coding, image & button works but the content element part is not displaying properly:
tt_content.gridelements_pi1.20.10.setup {
29 < lib.gridelements.defaultGridSetup
29 {
columns {
20.prepend = COA
20.prepend.20 = IMAGE
20.prepend.20.file.import.field = flexform_teaserimage1
20.insertData = 1
20.prepend.20.stdWrap.typolink.parameter.field = flexform_link1
20.prepend.20.wrap = <div class="csc-textpic csc-textpic-intext-left-nowrap"><div class="csc-textpic-imagewrap">|</div></div>
20.prepend.25 < .default
20.prepend.25.outerWrap = <div class="fiftycontent"><div class="csc-textpic csc-textpic-text">|</div></div>
20.prepend.25.stdWrap.typolink.parameter.field = flexform_link1
20.prepend.30 = IMAGE
20.prepend.30.file = {$tmplpath}images/button.png
20.prepend.30.stdWrap.typolink.parameter.field = flexform_link1
20.prepend.30.wrap = <div class="fiftylink">|</div>
20.prepend.wrap = <div class="fifty1">|</div>
}
wrap = <div class="largeteaser">|</div>
}
}
Basically all I wanted is for "20.prepend.25 < .default" to work, I tried "< tt_content" or
"< lib.gridelements.defaultGridSetup.columns.default" , the results are sometimes odd and duplicated many content. How do I get the same behavior as adding "< .default" ?
I got it, I'm not sure if this is the most elegant solution but I made use of prepend/append to sandwich the renderObj
columns {
20.outerWrap = <div class="fifty1">|</div>
20.prepend = COA
20.prepend {
20 = IMAGE
20.file.width = 386
20.file.height = 162
20.file.import.field = flexform_teaserimage1
20.stdWrap.typolink.parameter.field = flexform_link1
20.wrap = <div class="csc-textpic csc-textpic-intext-left-nowrap"><div class="csc-textpic-imagewrap">|</div></div>
}
20.renderObj = COA
20.renderObj {
25 =< tt_content
wrap = <div class="fiftycontent"><div class="csc-textpic csc-textpic-text">|</div></div>
25.stdWrap.typolink.parameter.field = flexform_link1
}
20.append = COA
20.append {
30 = IMAGE
30.file = {$tmplpath}images/button.png
30.stdWrap.typolink.parameter.field = flexform_link1
30.wrap = <div class="fiftylink">|</div>
}
}

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