Comments (6)
You can create a typoscript object which can then be called from a modified template to show the 3 most recent news items in the footer..
edit: you can actually use the typoscript_code extension to put the following in a content-element in one of the footer columns of your web site.
The following example shows the three most recent news items:
temp.latest3news < tt_content.menu.20.news
temp.latest3news.special.value >
temp.latest3news.special.value = 123
temp.latest3news.1.alternativeSortingField = uid DESC
temp.latest3news.maxItems = 3
Replace "123" with the page that has your news items.
from bootstrap_package.
I must agree that the current news example is quite complex if you dont have advanced knowledge on typoscript. Its maybe a good idea to provide a more simple example like show topnews xxx.
I will provide a second special menu with more simple rendering that will fit your needs that is easier to understand
from bootstrap_package.
Hi benjaminkott
If i have a page and I want to add a menu from the Base.ts file CTYPE: Menu, but I need that one in the Base.ts for another page and then i need to make some changes to the other menu.
How can I add a "Special Menus" -> "Display subpagesas News Entries" and then get it to use another copy of the CTYPE: MENU ? where du i place the new menu (under the main CTYPE: MENU in the base.ts fil).
What i want to copy and changes is, this code but i need to make two, bc. I have another place where I need a "Special Menus" -> "Display subpagesas News Entries" but with another layout.
#####################
CTYPE: MENU
#####################
tt_content.menu.20 {
news < .default
news {
maxItems = {$page.theme.news.pagination.itemsperpage}
begin.stdWrap.cObject = COA
begin.stdWrap.cObject {
5 = LOAD_REGISTER
5 {
paginateCounter.cObject = CONTENT
paginateCounter.cObject {
table = pages
select {
pidInList.field = pages
where.insertData = 1
selectFields = COUNT() AS counter
}
renderObj = TEXT
renderObj {
field = counter
wrap = |
}
}
paginateMaxPage.cObject = TEXT
paginateMaxPage.cObject {
data = register:paginateCounter
stdWrap.wrap = |/{$page.theme.news.pagination.itemsperpage}
stdWrap.wrap.insertData = 1
prioriCalc = 1
round.roundType = ceil
round.decimals = 0
}
paginateMaxPageAdd.cObject = TEXT
paginateMaxPageAdd.cObject {
data = register:paginateMaxPage
stdWrap.wrap = |+1
stdWrap.insertData = 1
prioriCalc = 1
}
paginateCurrentPage.cObject = TEXT
paginateCurrentPage.cObject {
data = GP:page
override = 1
override.if {
value.data = GP:page
isLessThan = 0
isGreaterThan.data = register:paginateMaxPageAdd
negate = 1
}
}
paginateStart.cObject = TEXT
paginateStart.cObject {
data = register:paginateCurrentPage
stdWrap.wrap = (|-1){$page.theme.news.pagination.itemsperpage}
stdWrap.insertData = 1
prioriCalc = 1
}
paginatePreviousPage.cObject = TEXT
paginatePreviousPage.cObject {
data = register:paginateCurrentPage
stdWrap.wrap = |-1
stdWrap.wrap {
override = |
override.if {
value = 1
equals.data = register:paginateCurrentPage
}
}
prioriCalc = intval
}
paginateNextPage.cObject = TEXT
paginateNextPage.cObject {
data = register:paginateCurrentPage
stdWrap.wrap = |+1
stdWrap.wrap {
override = |
override.if {
value.data = register:paginateMaxPage
equals.data = register:paginateCurrentPage
}
}
prioriCalc = intval
}
}
30 = TEXT
30 {
data = register:paginateStart
}
}
special = directory
stdWrap {
prepend >
outerWrap = |
append = COA
append {
10 = COA
10 {
##################
## PREVIOUS BTN ##
##################
10 = COA
10 {
10 = COA
10 {
10 = TEXT
10.value = <li
20 = TEXT
20 {
value = disabled
noTrimWrap = | class="|"|
if {
value.data = register:paginateCurrentPage
equals = 1
}
}
30 = TEXT
30.value = >
}
20 = TEXT
20 {
value = «
typolink {
parameter.data = page:uid
additionalParams = &page={register:paginatePreviousPage}
additionalParams.insertData = 1
}
}
30 = TEXT
30.value =
}
###########
## PAGES ##
###########
20 = TEXT
20 {
value =
split {
token = ,
cObjNum = 1
min.stdWrap.cObject = COA
min.stdWrap.cObject {
10 = TEXT
10 {
data = register:paginateMaxPage
}
}
1 {
5 = LOAD_REGISTER
5 {
currPageLink.cObject = TEXT
currPageLink.cObject {
data = register:SPLIT_COUNT
stdWrap.wrap = |+1
prioriCalc = intval
}
}
10 = COA
10 {
10 = TEXT
10.value = <li
20 = TEXT
20 {
value = active
noTrimWrap = | class="|"|
if {
value.data = register:currPageLink
equals.data = register:paginateCurrentPage
}
}
30 = TEXT
30.value = >
}
20 = TEXT
20 {
data = register:currPageLink
typolink {
parameter.data = page:uid
additionalParams = &page={register:currPageLink}
additionalParams {
insertData = 1
}
}
}
30 = TEXT
30.value =
}
}
}
##############
## NEXT BTN ##
##############
30 < .10
30 {
10.20.if.value.data = register:paginateMaxPage
10.20.if.equals.data = register:paginateCurrentPage
20.value = »
20.typolink.additionalParams = &page={register:paginateNextPage}
}
wrap =
- |
if {
value = {$page.theme.news.pagination.itemsperpage}
value.insertData = 1
isGreaterThan.data = register:paginateCounter
}
}
}
}
1 {
alternativeSortingField=starttime DESC
NO {
wrapItemAndSub = <article class="news-item">|</article> |*| <article class="news-item">|</article> |*| <article class="news-item">|</article>
doNotLinkIt = 1
doNotShowLink = 1
stdWrap2 {
cObject < tt_content.textpic
cObject {
10.if.isLessThan.field >
10.if.isLessThan = {$page.theme.news.list.imageorient}
10.10 = < lib.newsheader
20 < tt_content.image.20
20 {
preRenderRegisters {
allImageCaptions.cObject {
references {
table = pages
fieldName = media
}
}
}
addClassesCol.override.cObject.10.key.field >
addClassesCol.override.cObject.10.key = {$page.theme.news.list.imagecols}
addClassesCol.override.if.isGreaterThan.field >
addClassesCol.override.if.isGreaterThan = {$page.theme.news.list.imagecols}
layout {
key.field >
key = {$page.theme.news.list.imageorient}
25.override = <div class="image-header-{$page.theme.news.list.header_layout} image-beside-right image-beside###CLASSES###">###IMAGES######TEXT###</div>
25.override.if.isTrue.field = title
26.override = <div class="image-header-{$page.theme.news.list.header_layout} image-beside-left image-beside###CLASSES###">###IMAGES######TEXT###</div>
26.override.if.isTrue.field = title
}
textPos.field >
textPos = {$page.theme.news.list.imageorient}
maxW = {$page.theme.news.list.maxW}
maxWInText = {$page.theme.news.list.maxWInText}
imgList.cObject.references < tt_content.menu.20.news.1.NO.stdWrap2.cObject.20.preRenderRegisters.allImageCaptions.cObject.references
text < tt_content.textpic.20.text
text {
10 {
if.isGreaterThan.field >
if.isGreaterThan = {$page.theme.news.list.imageorient}
10 = < lib.newsheader
}
20.field = abstract
20.editIcons >
}
}
}
}
}
}
}
}
from bootstrap_package.
the following adds a Menutype labeled Display 3 latest subpages as news entries in the Backend, in the Frontend you get a Bootstrap row with 3 columns containing the 3 latest News (see warpItemAndSub = ... col-md-4). If you change maxItems to 4, you need to adjust wrapItemAndSub to use col-md-3. With 5 Columns on a 12-Grid maybe a bit trickier ;)
first you need to include this to your TS Setup:
#####################
#### CTYPE: MENU ####
#####################
tt_content.menu.20 {
news3 < .default
news3 {
maxItems = 3
special = directory
stdWrap {
prepend >
outerWrap = |
}
1 {
alternativeSortingField=starttime DESC
NO {
wrapItemAndSub = <div class="row"><div class="col-md-4">|</div> |*| <div class="col-md-4">|</div> |*| <div class="col-md-4">|</div></div><hr>
doNotLinkIt = 1
doNotShowLink = 1
stdWrap2 {
cObject < tt_content.textpic
cObject {
10.if.isLessThan.field >
10.if.isLessThan = {$page.theme.news.list.imageorient}
10.10 = < lib.newsheader
20 < tt_content.image.20
20 {
preRenderRegisters {
allImageCaptions.cObject {
references {
table = pages
fieldName = media
}
}
}
addClassesCol.override.cObject.10.key.field >
addClassesCol.override.cObject.10.key = {$page.theme.news.list.imagecols}
addClassesCol.override.if.isGreaterThan.field >
addClassesCol.override.if.isGreaterThan = {$page.theme.news.list.imagecols}
layout {
key.field >
key = {$page.theme.news.list.imageorient}
25.override = <div class="image-header-{$page.theme.news.list.header_layout} image-center image-below">###IMAGES######TEXT###</div>
25.override.if.isTrue.field = title
26.override = <div class="image-header-{$page.theme.news.list.header_layout} image-center image-below">###IMAGES######TEXT###</div>
26.override.if.isTrue.field = title
}
textPos.field >
textPos = {$page.theme.news.list.imageorient}
maxW = 500
maxWInText = 500
imgList.cObject.references < tt_content.menu.20.news3.1.NO.stdWrap2.cObject.20.preRenderRegisters.allImageCaptions.cObject.references
text < tt_content.textpic.20.text
text {
10 {
if.isGreaterThan.field >
if.isGreaterThan = {$page.theme.news.list.imageorient}
10 = < lib.newsheader
}
20.field = abstract
20.editIcons >
}
}
}
}
}
}
}
}
second you need to add this to your Page-TS-Config in order to get the Menuitem in the Backend:
#################
#### TCEFORM ####
#################
TCEFORM {
tt_content {
menu_type {
addItems {
news3 = Display 3 latest subpages as news entries
}
}
}
}
from bootstrap_package.
Is this still relevant with current versions? If so, can you pull request a solution that pleases you?
from bootstrap_package.
@cedricziel i´ve decided to drop these news listing, as it was only an extensive typoscript example that almost nobody understood - i think a basic news implementation will be more usefull
from bootstrap_package.
Related Issues (20)
- Home page header flashes when scrolled to a certain position HOT 1
- Text and Icon not working after Upgrade or in an new v12 HOT 8
- Can't activate dark color mode HOT 1
- Allow using SCSS files for contentsCss stylesheets
- Best practise for customisations & theming
- Custom CSS property pre-fix breaks in v14
- Is $navbar-dropdown-columns ever used?
- _list.scss / _link.scss missing !default at variables and naming issue
- obsolete layout.upload code in TCEFORM.tsconfig
- Failed to open stream: No such file or directory
- List of breaking changes from v12 to v14 HOT 1
- RTE: in the tables with <ol> or <ul>
- (1/1) TypeError strpos(): Argument #1 ($haystack) must be of type string, TYPO3\CMS\Core\Resource\FileReference given
- Cannot cast value of type array to string.Array ( [multiplier] => Array ( [default] => 0.5 [xlarge] => 0.5 [large] => 0.5 [medium] => 0.5 [small] => 0.5 ) [gutters] => Array ( [default] => 16 [xlarge] => 16 [large] => 16 [medium] => 16 [small] => 16 ) [corrections] => Array ( [default] => 2 [xlarge] => 2 [large] => 2 [medium] => 2 [small] => 2 [extrasmall] => 2 ) ) HOT 2
- Render gallery container in TextpicAbove and TextmediaAbove only if files exist
- small carousel items don't get the right language when used drag and drop from one language to a second
- Data processing of image/assets/media don't work using EXT:TYPO3 CMS Content Blocks HOT 1
- url()-function in ScssParser doesn´t resolve urls to public resources in composer-mode
- Make color scheme support more flexible (or update docs?)
- Dynamic Content contentFromPid only in default language
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap_package.