I want to create simple HTML button which links to other page when user clicks on it. I am new to Drupal, I've seen that we can create fields from "Structure>Content Types>Article>Manage Fields>Add new field - Field types.."
Can we create button from this way or we have to write code to create it?
Thanks
There is a beta module called Button Field that works with the Rules module. I believe will do what you're looking for. You can add a button to any fieldable entity and define a rule for it when it's pressed.
See https://drupal.org/project/button_field and https://drupal.org/project/rules
Buttons typically have to be coded. The way you're talking about above is the process for creating form elements for creating new pieces of content. If you want a simple button on a page to link to another page, you can just code it as follows:
<input type="button" value="Visit Another Page" onclick="location.href='your/other/web/page'" />
You may need to install a WYSIWYG text editor to add HTML to a page, if you don't already have one.
Or just use the Field Button module:
https://drupal.org/project/button_field
and create the buttons as you create fields...
With the help of views or webform, block module can create a button with out writing code.
Related
I need to add the send button twice to my form build using Orbeon Form builder; the first one should display 'Submit' and the other one should display 'Print and Submit'. But I see that the first label is getting replaced by the last one. Can some one please tell me how to add two different labels for the same button when when adding it twice to the form. This for a requirement where the form need to have two buttons. First one should submit the form to a rest service( I am using send button for this) and the second one should print and submit the form to rest service. Please help.Thank you.
As you have found out, you cannot put the same button twice. They have to be different buttons, which means that they have a different name. If a button is called send then the other one must have another name like send-and-print.
So create one button called send, the other one must be called something else. So you simply create a new button following Button and processes.
The open-rendered-format action is new in Orbeon Forms 2017.1. You don't say which version you are using though.
I would also properly format the process so that you can easily take out and add parts, and see which part(s) fail:
<property as="xs:string" name="oxf.fr.detail.process.send-and-print.*.*">
require-uploads
then require-valid
then save
then open-rendered-format(format = "pdf")
then save-final
then send(uri="http://192.168.25.18:8080/RestService/rest/xml", content="xml", replace="instance") then
navigate("http://192.168.25.18:8080/email-sent-virgin-ausi.html")
recover navigate("http://192.168.25.18:8080/email-fail-virgin-ausi.html")
</property>
According to Create.js' integration guide, it should be possible to create editable collections of blocks.
Relationships between entities allow you to communicate structured
content to Create.js, which will turn them into Backbone collections.
For example, to annotate a list of blog posts:
<div about="http://example.net/blog/" rel="dcTerms:hasPart">
<div about="http://example.net/my-post">...</div>
<div about="http://example.net/second-post">...</div>
</div>
This dcTerms:hasPart doesn't seem to be present explicitly in Create.js; it's probably from a vocabulary. How can one show to Create.js that this content is a collection and make it show the "Add" button? In my case, I simply have sections which contain <h2>, <h3> and <article>s.
EDIT: Using rel="hasPart" in my <section>, the button appears. Problem is Create always uses the first element as a template. In this case, it uses my <h2> as template, which is not what I intended. So my question now would be how to trigger the "add" event in my section?
Hackish solution:
Using javascript, I created a new section or article in the DOM, then restarted Create calling $('body').midgardCreate({...}) again. Create will now recognize the new block. When I edit some fields in the block, the "Save" button is enabled and I can submit the new block.
I have a Grid, which have a TopToolbar and BottomToolbar. In the BottomToolbar, I added a CSVDataExporter:
CSVDataExporter csvDataExporter = new CSVDataExporter();
csvDataExporter.setDataFormatNameModel(new ResourceModel("csv.export.link.name"));
csvDataExporter.setDelimiter('|');
addBottomToolbar(new ExportToolbar(this).addDataExporter(csvDataExporter));
I have the link, so I can export the table to CSV fine!
BUT! How could I change the CSV export link to be a Button, but do the same and be at the same place as it was? Thank you!
The Link is generated by your ExportToolbar using the createExportLink method. To generate something else (as in any other component) you can extend the ExportToolbar to override this method. If this is the only place where you need this functionality, you can do so by implementing an anonymous inner class.
Generally you'll want this method to return a Component that has it's own markup, like a Panel, that contains whatever you want to display as your Exportlink or -button.
Am working on a Symfony2 application whose among its functions will allow the user to select to visit different sections of the site, and this from anywhere (any page) of the site. For simplifying let's say: when a user want to sort he/she choose from a drop down select form and submit.
I built the action and template with a test root to verify this function and this work (when I use directly the rendering of that sortAction() on my app_dev/test adress.
The issu is that when I try to make this action accessible from the general template (app/Resources/views/base.html) I can view the select form with default view, but when I select for a sort and try to Submit page relaods and return to the defaut view.
I use {% render "MycompanyMybundleBundle:Mycontroller:sort" %} in .../base.html and I want this action to work on (like) mysite/anypage this last extending bundle layout which (layout also extent base).
Can anyone help me?
The description of your problem isn't realy clear, but I think the problem lies at the form action. Do you've configured this action? You should leave it empty if you want to submit it to the same page.
Another solution would be to make use of the extending posibilities of Twig. Define the form as a block in the parent, and override it in the child.
http://twig.sensiolabs.org/doc/tags/extends.html
EDIT:
You could make the form action a block, that is what I mean...
<form action="{% block formAction %}defaulttargetpage.php{ %endblock% }"> <!-- formcontent --> </form>
My requirement is to have database based help system for asp.net website, as shown in the image below. i have searched web but could not find even remotely related solution.
DNN Help System http://img3.imageshack.us/img3/6720/dnnhelpimage20091125.jpg
You could assign each help item a unique ID (perhaps GUID to make it easier to generate by the developer enabling help for that item).
Clicking on the link opens a dialog, tooltip, new window, whatever. Just have the UI load the help text by ID from the database.
To make this easier to implement in the UI, there are a few ways. Perhaps you can create a jQuery client-side behavior.
your HTML would look something like:
<span class="help" id="#{unique-id-here}">Admin</admin>
and you could have jQuery on DOM load:
$(function() {
var help = $(".help");
help.prepend("<img src=\"path/to/images/help.png\" />");
help.click(function() {
//do something with this.id; open a popup, a title bar, whatever.
}
});
We did it on our site by doing the following:
We have a HelpTopics database with a HelpTopicId and HelpTopicText
We create an aspx page that displays the HelpTopicText based on the HelptopicId passed in the querystring.
We set up a css class for the A tag that displays the link to the help with the question mark image.
We created a UserControl named TitleandHelp that contained a link to the page mentioned in step 2 and the style for the link set to step 3 above: The usercontrol has a public rpoperty for the title and one for the topicID (We called it HelpContext).
We add the usercontrol to the aspx page where appropriate
<uc2:titleandhelp ID="titleandhelp1" runat="server" HelpContext="4" PageTitle="Forgot Password" />
it may sound like a lot of work, but really it only takes a half hour or so to do all of the setup. The rest of the work lies in populating the table and dragging the usercontrol onto the pages where appropriate.