Skip to content

Commit

Permalink
[FEATURE] Add title tag selection to content element
Browse files Browse the repository at this point in the history
  • Loading branch information
t3brightside committed Oct 22, 2022
1 parent e6070d1 commit 486ba26
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 13 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@
* 3.4.0
- [TASK] Rewrite back end previews using PreviewRenderer
- [TASK] TYPO3 12 compatibility
* 3.5.0
- [FEATURE] Add title tag option to content element for improved semantics control
14 changes: 14 additions & 0 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,19 @@
],
]
],
'tx_pagelist_titlewrap' => [
'exclude' => 1,
'label' => 'Title wrap',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'default' => 0,
'items' => array(), /* items set in page TsConfig */
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
],
);


Expand Down Expand Up @@ -257,6 +270,7 @@

$GLOBALS['TCA']['tt_content']['palettes']['pagelist_layout']['showitem'] = '
tx_pagelist_template,
tx_pagelist_titlewrap,
tx_pagelist_disableimages,
tx_pagelist_disableabstract,
';
Expand Down
8 changes: 8 additions & 0 deletions Configuration/page.tsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ TCEFORM.tt_content.tx_pagelist_template.addItems {
}
TCAdefaults.tt_content.tx_pagelist_template = cards

TCEFORM.tt_content.tx_pagelist_titlewrap.addItems {
h2 = H2
h3 = H3
h4 = H4
p = p
}
TCAdefaults.tt_content.tx_pagelist_titlewrap = h3

mod.wizards.newContentElement.wizardItems.common {
elements {
pagelist_sub {
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Card.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</figure>
</f:if>
<div class="text">
<h3 class="title">{page.data.title}</h3>
<{data.tx_pagelist_titlewrap} class="title">{page.data.title}</{data.tx_pagelist_titlewrap}>
<f:if condition="{page.authors} || {page.data.tx_pagelist_datetime}">
<p class="info">
<f:if condition="{page.data.tx_pagelist_datetime}"><span class="date">
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/ListArticle.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="item article{f:if(condition: '{data.tx_pagelist_disableimages} == 1', then: ' noimage')}{f:if(condition: '{data.tx_pagelist_disableabstract} == 1', then: ' nointroduction')}">
<f:link.page pageUid="{page.data.uid}" target="{page.data.target}" title="{page.data.title}">
<h3 class="title">{page.data.title}</h3>
<{data.tx_pagelist_titlewrap} class="title">{page.data.title}</{data.tx_pagelist_titlewrap}>
<f:if condition="{page.authors} || {page.data.tx_pagelist_datetime}">
<p class="info">
<f:if condition="{page.data.author}">{page.data.author}</f:if>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/ListEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>
</f:if>
<div class="text">
<h3 class="title">{page.data.title}</h3>
<{data.tx_pagelist_titlewrap} class="title">{page.data.title}</{data.tx_pagelist_titlewrap}>
<f:if condition="{page.data.tx_pagelist_eventlocation}">
<p class="info location">
☉ {page.data.tx_pagelist_eventlocation}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/ListPage.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="item{f:if(condition: '{data.tx_pagelist_disableimages} == 1', then: ' noimage')}{f:if(condition: '{data.tx_pagelist_disableabstract} == 1', then: ' nointroduction')}">
<f:link.page pageUid="{page.data.uid}" target="{page.data.target}" title="{page.data.title}">
<h3 class="title">{page.data.title}</h3>
<{data.tx_pagelist_titlewrap} class="title">{page.data.title}</{data.tx_pagelist_titlewrap}>
<f:if condition="{data.tx_pagelist_disableabstract} == 0">
<f:if condition="{page.data.abstract}">
<p class="abstract">{page.data.abstract}</p>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/ListProduct.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="item product {f:if(condition: '{data.tx_pagelist_disableimages} == 1', then: ' noimage')}{f:if(condition: '{data.tx_pagelist_disableabstract} == 1', then: ' nointroduction')}">
<f:link.page pageUid="{page.data.uid}" target="{page.data.target}" title="{page.data.title}">
<h3 class="title">{page.data.title}</h3>
<{data.tx_pagelist_titlewrap} class="title">{page.data.title}</{data.tx_pagelist_titlewrap}>
<f:if condition="{data.tx_pagelist_disableabstract} == 0">
<f:if condition="{page.data.abstract}">
<p class="abstract">{page.data.abstract}</p>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/ListVacancy.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="item vacancy{f:if(condition: '{data.tx_pagelist_disableimages} == 1', then: ' noimage')}{f:if(condition: '{data.tx_pagelist_disableabstract} == 1', then: ' nointroduction')}">
<f:link.page pageUid="{page.data.uid}" target="{page.data.target}" title="{page.data.title}">
<h3 class="title">{page.data.title}</h3>
<{data.tx_pagelist_titlewrap} class="title">{page.data.title}</{data.tx_pagelist_titlewrap}>
<f:if condition="{page.data.tx_pagelist_datetime}">
<p class="info">
<f:if condition="{page.data.tx_pagelist_datetime}">
Expand Down
13 changes: 7 additions & 6 deletions Resources/Public/Styles/pagelist.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@
text-decoration: none;
}

.pagelist a p {
.pagelist a .info p {
color: #333;
}

.pagelist p.title {
font-weight: bold;
font-size: 1em;
}

.pagelist .info {
font-size: 0.85em;
margin-bottom: 0.2em;
Expand Down Expand Up @@ -153,15 +158,11 @@
}

.pagelist.list .title {
font-size: 1.25em;
margin-top: 0em;
}

/* Event speciffic */
.pagelist.list .event .text {
margin-left: 5em;
padding-left: 1em;
}

.pagelist.list .event .dates {
width: 5em;
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'title' => 'Pagelist',
'description' => 'Create page lists/teasers and add page types for news, events, products and vacancies.',
'category' => 'fe',
'version' => '3.4.0',
'version' => '3.5.0',
'state' => 'stable',
'clearCacheOnLoad' => true,
'author' => 'Tanel Põld',
Expand Down
1 change: 1 addition & 0 deletions ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CREATE TABLE tt_content (
tx_pagelist_startfrom varchar(6),
tx_pagelist_limit varchar(6),
tx_pagelist_recursive int(1) DEFAULT '0' NOT NULL,
tx_pagelist_titlewrap varchar(2),
);

CREATE TABLE pages (
Expand Down

0 comments on commit 486ba26

Please sign in to comment.