Trying to get into typo3; unfortunately the docs aren't really helpful for me. After creating a backend-layout I am trying to output multiple columns.
Right now I'm getting the following output:
<div id="c23" class="frame frame-default frame-type-text frame-layout-0">
<a id="c30"></a>
<header>
<h2 class="">Title</h2>
</header>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed …</p>
</div>
I'd like to have the output without any extra elements, like this:
<h2>Title</h2>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed …</p>
What is the correct way to get the "correct" output in typoscript?
Such HTML attributes comming from EXT:fluid_styled_content (/typo3/sysext/fluid_styled_content/Resources/Private/Layouts/Default.html).
To adapt this and all other files, you should make a copy of folders Templates, Partials, Layouts from /typo3/sysext/fluid_styled_content/Resources/Private, define them via typoscript constants as new paths:
styles.templates {
templateRootPath = [PATH/TO/YOUR/FOLDER/Templates]
partialRootPath = [PATH/TO/YOUR/FOLDER/Partials]
layoutRootPath = [PATH/TO/YOUR/FOLDER/Layouts]
}
and adpat them for your needs, especially /PATH/TO/YOUR/FOLDER/Layouts/Default.html
This is best done in a recommended own sitepackage. You could use https://sitepackagebuilder.com/new/ to start with.
If is TYPO3 7.6
Yo need to override boostrap-package Layouts/ContentElements/Default.html
because there are created that classes and from that files remove wrapper
div id="c{data.uid}" class="frame frame-type-{data.CType} frame-layout-{data.layout} {sectionClass}"
Only wrapper!
with FSC (fluid_styled_content) all your markup is in fluid-templates, which you can override.
go to your server and copy files from (webroot)/typo3/sysext/fluid_styled_content/Resources/Private/ + Layouts/ and/or Partials/ and/or Templates/.
In typoscript setup you need to define additional pathes to your variants.
Don't copy all files, but copy only those you modify.
In your case you probably need to modify the Layouts/* and Partials/header.
Related
I would like to integrate the structured data mainContentOfPage with the JSON-LD format.
I need to specify the part of the DOM, so I use the cssSelector property.
This is what the data looks like:
{
"#context": "http://schema.org/",
"#type": "WebPage",
"mainContentOfPage": {
"#type": "WebPageElement",
"cssSelector": "#landingPage",
},
}
The structured data test tool gives me a warning:
The property value is not recognized by Google for an object of type WebPageElement.
How can I do this?
You can test this code in the SDTT:
<html lang="fr">
<head>
<meta charset="UTF-8">
<script type="application/ld+json">
{"#context":"http://schema.org/","#type":"WebPage","mainContentOfPage":{"#type":"WebPageElement","cssSelector":"#landingPage"}}
</script>
</head>
<body>
<div id="landingPage">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In non molestie libero.</div>
</body>
</html>
cssSelector is not part of schema.org core yet. You can't use it as part of schema.org yet, only when it's moved from pending to core.
The term 'cssSelector' is not in the schema.org core vocabulary, but is defined in an extension:
pending: cssSelector
https://schema.org/cssSelector
I'm new to twitter-bootstrap, and this question is probably answered 1000 times - I can't find proper search terms.
If I want to repeat the same group-of-classes on multiple elements, how can I tell bootstrap to apply all classes in that group onto certain elements?
e.g. (pseudo-code)
animal: {col-zz-5 tip tralala trili li kuki top-margin-20 lorem ipsum}
<li meta-class="animal">gamal</li>
<li meta-class="animal">soos</li>
<li meta-class="animal">kipod</li>
and NOT:
<li meta-class="col-zz-5 tip tralala trili li kuki top-margin-20 lorem ipsum">gamal</li>
<li meta-class="col-zz-5 tip tralala trili li kuki top-margin-20 lorem ipsum">soos</li>
<li meta-class="col-zz-5 tip tralala trili li kuki top-margin-20 lorem ipsum">kipod</li>
constraints:
I REALLY prefer not to add external solution like LESS, which adds another level of complication (learning, loading, performance and maintenance).
I don't want to do that on the server.
BTW: my current projects are based on angular - so if there's a built-in angular solution, this is also accepted. E.g. I can write my classes as class="{{ animal }}", and define "animal" somewhere central (where?)
Edit:
I forked #NeilKistner 's fiddler => with a working solution: http://jsfiddle.net/qaZmF/
hope to hear more solutions before I close this one.
Using AngularJS I was able to come up with this, you should be able to adapt it to your project.
HTML
<div ng-app="App">
<div ng-controller="Ctrl">
<li meta-class="{{ animal }}">gamal</li>
<li meta-class="{{ animal }}">soos</li>
<li meta-class="{{ animal }}">kipod</li>
</div>
</div>
JS
function Ctrl($scope) {
$scope.animal = 'col-zz-5 tip tralala trili li kuki top-margin-20 lorem ipsum';
}
JSFiddle: http://jsfiddle.net/2c24r/
I’m working in the Moovweb SDK and am optimizing my personal desktop site for mobile.
How do I transform all my <p> tags to <div> tags? I really don't want to do it manually! Search and replace?? haha
You can use the name() function to change the name of an element. For example:
$("//p") {
name("div")
}
See it in action here: http://tester.tritium.io/bd1be4f2c187aed317351688e23f01127d26343a
Cheap way: Add p{margin:0} to your CSS, this will remove the only special styling of <p> tags making them look like <div>s.
This is only a visual effect, though. For instance, you're still not allowed to put a <form> inside a <p>, even with the above CSS. If that's what you're after, a simple search and replace will do:
Replace <p> with <div>
Replace <p␣ (left angle, p, space) with <div␣ (there's a space at the end of that one too)
Replace </p> with </div>
That should do it!
I'm looking for the possibilities that GWT, SmartGWT, offers in terms of dynamically changing the inner HTML text of an element.
Let go though an example :
I have some lorem ipsum text in a DIV element as it follows :
<div id="text">
Lorem <span style="background-color:red">ipsum </span>
dolor sit amet, consectetur adipiscing elit.
Duis convallis iaculis
<span style="background-color:red">ipsum </span>
magna sagittis vel. Lorem
<span style="background-color:red">ipsum </span> dolor sit amet.
</div>
Desired functionality :
I want the user to be allowed to decide at runtime what text is "marked" (red colored). This impact in two things :
Being able to remove an span element, thus replacing
<span style="background-color:red">ipsum </span>
by
ipsum
Being able to add an span element (by doing the opposite)
Once the user has selected the text he wants to "mark", I use something like
RootPanel.get("text").getElement().
setInnerHTML("html content with some new spans tags");
to update the HTML code with the new selection (to achieve that I have some GWT classed that keeps track of the marked text).
This seems to be a little brutal for me because I'm in a situation that I often update the inner HTML code.
Is there any way using GWT (working closely with the DOM) or SmartGWT, to achieve that in a less violent way ?
To access the DOM of your page you can call Document.get(), which has a convenience method for finding an element by it's id Document.get().getElementById("test");
Of course, you should keep a reference to this element so as not to have to search through the DOM everytime you want to access it, because this is brutal.
private Element testDiv = Document.get().getElementById("test");
...
testDiv.setInnerHTML("Some html");
...
testDiv.setInnerHTML("Some other html");
But once you have a reference to this element, calling setInnerHTML is the most efficient way to do what you want. I'm not sure why you think this is brutal. This is probably even more efficient than when you call a method on a widget to change it's content, like setText(" ...") on a TextBox for example, because these methods usually check the value passed as parameter for security.
Security could also be a concern for you, depending on what the user can do. But usually if a user can modify the HTML in your page that's a concern. You might want to look at GWT's SafeHTML feature.
If you're looking for RichText components, you can look at GWT's RichTextArea for example. But this type of component is usually not well supported by all browsers and will take more resources than what you're doing already so I don't recommend it.
I want to add new columns to the trac AccountManager plugin, I already edited the admin_user.html, but in python what do I have to edit, which files. I want to add two more data field. ex: group and telephone, How can I do that?
UPDATED
This is the two field I added in the admin_user.html
<div class="field">
<label>Telephone:<br />
<input type="text" name="tel" class="textwidget"
value="${account.tel}" /></label>
</div>
<div class="field">
<label>Group:<br />
<input type="text" name="group" class="textwidget"
value="${account.group}" /></label>
</div>
and I also added the two column to the table:
<td>${acct.group}</td>
<td>${acct.last_visit}</td>
But I'm not familiar with python, so I don't know how can I add the functionality in the python code
Did you check UserManagerPlugin for it's ability to add arbitrary new columns?
But maybe you want it some additions to the generic view in users admin page, right? These must be optional, if you care for universal use, of course.
In 'admin.py' you'll see a Class 'AccountManagerAdminPages' with a module '_do_users'. This module is primary handler for all requests related to the admin page in question. While the beginning is about processing 'POST' (user input) everything after the line 'if listing_enabled:' will prepare the page displayed next. You'll see various sources, but main source is query to Trac db table 'session_attribute'.
Again I'd like you to take a look at UserManagerPlugin - all what you may want and more.
Disclosure: I'm the current maintainer of AccountManagerPlugin.