How to change the label of view/results buttons in Webform drupal-7 - drupal-7

I am a newbie in drupal, webform and php. Actually I have installed the drupal-7 with the webform module and I want to modify the text of options i.e. "view" to "create project" and "Results" to "View Projects"...
I searched for solution and I noticed that best option is to create a custom module and use hook_form_alter() to modify, so I have created a custom module. But I dont know how I can modify.
Kindly excuse me if the solution is already there (I could not find it :( )

"View" and "Results" are actually menu items, which you can modify by implementing hook_menu_alter().
http://drupal.org/node/483324
The following code in a custom module (change MODULENAME to the name of your module) will update the "Results" tab without a hitch, however the "View" tab is trickier because that's the core "view node" menu item. The code below will update this menu item for ALL node types, not just webforms. If you don't see the changes, clear your cache.
As far as I know there is no way to alter menu items ("View" in this case) for specific node types. See http://drupal.org/node/754508 for some attempts and discussion.
function MODULENAME_menu_alter(&$items) {
// change webform "Results" to "View Projects"
$items['node/%webform_menu/webform-results']['title'] = t('View Projects');
// change "View" to "Create Project" - affects *all* node types, not just webforms
$items['node/%node/view']['title'] = t('Create Project');
}

Ey I found one easy way to change everything in everything drupal 7 maybe in others try the moduls to install is String Overrides, link: http://drupal.org/project/stringoverrides, then you put the name in the configuration username and the newname
I hope this information is useful
add a picture how! >> http://s2.subirimagenes.com/otros/previo/thump_7143242string.jpg

Related

wagtail modeladmin: is it possible to add "explore child pages" column?

I've been using wagtail-modeladmin to create custom lists of certain page types. That gives me the ability to edit those pages. But I'd also like to be able to click through somehow to the "normal" admin explorer version of those pages, and be able to view/add child pages to them.
essentially giving myself a column with the little arrows in on the right, just like in the normal wagtail admin page explorer...
OK I know it's bad form to answer your own question, but I've got this working by using a custom method on the model admin object that reverse wagtails admin urls:
class MySpecialPageModelAdmin(ModelAdmin):
def view_children(self, obj):
url = reverse('wagtailadmin_explore', args=[obj.id])
return format_html(f'View Children')
list_display = ('title', 'live', 'view_children')
but actually, I think I'm not going to end up using this, just replacing this particular modeladmin with a direct link to the right place in the explorer.

Label for sonata admin embedded add button

Is there a way to change the label for 'Add new' buttons when embedding collections in sonata admin? I have a couple of nested forms and the buttons are confusing for the user to say the list
Copy file sonata-project/admin-bundle/Resources/translations/SonataAdminBundle.[your_language].xliff to
app/Resources/SonataAdminBundle/translations/SonataAdminBundle.[your_language].xliff
Find the key link_action_create and change the the target text:
<trans-unit id="link_action_create">
<source>link_action_create</source>
<target>Add new</target> //Change to what ever you want.
</trans-unit>
If values do not change Clear cache, sometimes the old values from cache are shown:
php bin/console cache:clear

Setting Up Dynamic Redirects upon User registration/login - Joomla

I'm not sure if this is possible at all but this is what I want to acheive:
The website I am working on for a martial arts school.I have program pages that give general info on them. Then I have a link that says 'register to view available times' (for a free trial).
I am wondering how to get the user to the specific page for that program's registration. After that, I want to apply the same sort of thing to each program page. E.g. If I am on kids classes > Register > Redirect to Kids Class Times
Womens > Register > Redirect to Women's Class Times.
Also, want the same thing to happen for a 'login' function.
Joomla natively does not support this. You will have to use a third party extension to achieve this. I have used Community Builder (https://www.joomlapolis.com/) before that is both free and open-source that can do what you want.
If i understood your question you like to put some content in to view only for person who is registered on your website.
Here is how to.
1. Create menu item in menu manager >
Add content to your menu. ( modules , articles ) > .
Set the same menu item from Public to Registered.
Button to do so, will be on right side tab: " Details " in menu setting.
2.Then you create a link to these menu or item alias which is public. When the person will click on link the joomla will ask for login and redirect to the menu page.
Hope this helps.

Drupal 7: How do I extract specific field in a taxonomy page

How do I extract specific field for display in a taxonomy page?
I have a custom content type called "film" and each film has a Term Reference field called "casting". As expected I can click on a "casting" (tag) it brings me a page where all films are listed wherever this tag is associated. For expample if I click on "Kate Winslet" from movie Titanic, I land on a page http://localhost/mysite/tags/kate-winslet where other movies of Kate Winslet are listed. Up to this point everything is just fine.
I do not want Drupal to pull in and show default fields like just Title and Body in its own display format. Rather I want it so that I can display a photo from each film, year of release and of course the title and trimmed version of the body. I only want to customize the content of this page so that I have the control over What to Show and Where To Show a specific field value.
This is what I tried:
I cloned and put page.tpl.php in my theme's template folder. Renamed it as page--vocabulary--tags.tpl.php. Then I took out the following line of code (<?php print render($page['content']);?>) from my page--vocabulary--tags.tpl.php. The intention was to check whether the overridden template is actually being accessed by Drupal or not. It does!
But I am not been able to extract fields like field_photo or field_release_date from $page['content]. To get an idea about defined variables and how they are placed I used the following line of code:
<pre><?php /*print var_export(get_defined_vars(), TRUE);*/ ?></pre>. But even from there I could not extract a particular field like I mentioned above. The fields look to be somewhere inside $page['content']['system_main']['nodes'], but I don't know how to get to a specific field directly.
I also created a template.php with the following preprocess hook function:
<?php
function introduction_preprocess_page(&$vars) {
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
$term = taxonomy_term_load(arg(2));
$vars['theme_hook_suggestions'][] = 'page__vocabulary__' . $term->vocabulary_machine_name;
$vars['content'] = $vars['page']['content']['system_main']['nodes'];
}
}
?>
Both <?php print render($content) ?> and <?php print render($page['content']) ?> print the same result but I want something like <?php render($content['photo_field'])?> which I am not been able to.
I am sorry for making this too long. I have just stepped into Drupal. So wanted to make sure that what I am trying to explain matches exactly what I want to accomplish.
You are probably trying the long way to this.
You can use Views module. It allows to create custom listings querying the database, but also override existent ones, like the case of the taxonomy term page listing.
Once you have the module installed (if it's not yet), particularly the Views UI module, go to /admin/structure/views and scroll to bottom, where disabled views (grayed rows) are. You'll find one called Taxonomy term, described as 'A view to emulate Drupal core's handling of taxonomy/term.'
Click Enable on the right of it and then go to the same place where the Enable link is, click the arrow to unfold and choose Edit.
Once you're in the view edit page, you can manipulate the listing at your convenience, adding/removing fields or whatever you want to do in your particular case. If you are not familiar with Views, I recommend you to learn about it, there is a lot of related content on the web and it is close to essential for Drupal development.
Also, if you want to add more customisation to the page, you can use the same approach with the Panels module, who allows to override system pages (not just listings like Views).

DotNetNuke Switching Between Multple Edit Modules

I have a custom module in DNN 7 that has a data structure where items belong to categories (called "sections", not DNN taxonomy, just a simple list of section names). The module edit screens work so that on the view control you may click on an edit link on each category, which loads the category edit screen (passing the category id). This works great, and when you save I use Globals.NavigateURL() to return to the view screen. This all works as intended.
On each category edit screen I also have a list of the items within that category, each with an edit link. Clicking the edit link opens the item edit screen, passing the correct item id, and allowing me to edit that item. This all works great, until you save. The save works properly, but when I want to send the user back to the edit screen for the category it doesn't work. When I use:
Response.Redirect(EditUrl("SectionId", sectionid.ToString(), "EditSections"), true);
...nothing happens. It simply doesn't redirect anywhere. This is exactly the same URL I'm using to get to the category edit page in the first place:
EditUrl("SectionId", Eval("SectionId").ToString(), "EditSections")
And then I use a similar URL to get to the item edit page:
EditUrl("ItemId", Eval("ItemId").ToString(), "EditItems")
I don't understand why using the same URL to navigate to the same page I already navigated to would simply not do anything. For now I am sending them all the way back to the view, but it's painful if you need to add several items to the same category to have to navigate back into the category and add another item, only to be sent back to the view.
Anyone see anything like this before?
Have you tried to use the overload of NavigateUrl instead of EditUrl?
Globals.NavigateURL(TabId, "EditSections", "mid", ModuleId.ToString(), "SectionId", Eval("SectionId").ToString())
I haven't seen that myself but I would have to assume that somehow the context is being lost with EditURL and you're not getting sent to the proper location due to that.
I would suggest you try one of two things (or both).
Debug the URL that EditURL is returning and see if you can find the
difference.
Use NavigateURL for all your links and pass in MID=## for your
moduleid as a querystring parameter, to ensure that the proper
values are being passed.
UPDATE: If you're trying to have multiple edit views, and move between them, you might look at using a "loader" instead of having separate module definitions for the edit controls. Basically have a single Edit.ascx file defined, and it loads other ASCX files within it, injecting into a Panel. The View control on this module http://dnnsimplearticle.codeplex.com/ does that, but I haven't tried it with an edit control before.

Resources