views

Drupal 7 Views Contextual Filters

允我心安 提交于 2019-12-09 23:41:08
问题 I'm trying to create a view with a contextual filter on the title of the node and was wonder if there was a way to pass in a single letter as the argument and have the view return all node that begin with that letter? Currently I've not found a way to do this, I have to pass in the full title of the node for it to work properly. Thanks for any help. 回答1: To get this to work I had to provide a default value: And then I also had set up the Glossary Mode: I had set up the Glossary Mode before

I cannot add views when reverse engineering my database in Visio

烂漫一生 提交于 2019-12-09 23:07:33
问题 I am trying to reverse engineer parts of a 2012 SQL Server into Microsoft Visio 2010. The views option is greyed out. The views are integral to the processes I am trying to document, and the diagram will be useless without them. Does anyone have an easy work-around other than manually inputting the views? 回答1: You are probably using "wrong" data provider to reverse engineer the database, and that is the reason why views are disabled. There are some issues with Visio not being updated to

After MVC3 publish, just update the views

人盡茶涼 提交于 2019-12-09 20:08:31
问题 .NET/MVC3 newbie, so please bear with me! I've searched for this answer all over but cant find exactly what im looking for, so here it comes... Lets say that i'm developing an MVC3 app with Visual Web Developer Express and i go about deploying the site using the built in publishing tool. But now that my site is up and running i find that i need to make a minor adjustment in one of the views. I update the view and save the file, and use my FTP program to upload the new file. The problem is

drupal views 限制汉字输出长度

◇◆丶佛笑我妖孽 提交于 2019-12-09 19:39:13
需要修改views.module模块: 一、增加一个函数 //截取中文字符串 function gbsubstr($gbk, $start, $len) { $tmpstr = ""; $strlen = $start + $len; for($i = 0; $i < $strlen; $i++) { if(ord(substr($gbk, $i, 1)) > 0xa0) { $tmpstr .= substr($gbk, $i, 2); $i++; } else $tmpstr .= substr($gbk, $i, 1); } return $tmpstr; }; 二、修改 views_trim_text函数: function views_trim_text($alter, $value) { $gbk=mb_convert_encoding($value, "GBK", "UTF-8");//增加的 //dsm(strlen($gbk)); //dsm($value); if ( strlen ($gbk) > $alter['max_length']) { //将drupal_ strlen 修改为 strlen //$value = drupal_substr($value, 0, $alter['max_length']); $u8 = gbsubstr($gbk,

Sinatra Sub-Directory Views

佐手、 提交于 2019-12-09 07:38:15
问题 I want to be able to get Sinatra views from sub-directories of ./views (such as ./views/admin). I know you can set the views like so: set :views, Proc.new { File.join(root, "templates") } But how would I be able to set this for only part of the file? 回答1: I'm not sure exactly what you're asking, but you can render a view in views/admin by doing this: erb :"admin/report" If you're asking how to automatically look in subdirectories of views when you call erb :report , I'm not sure how to do

How do I add JavaScript to an ASP.NET MVC View?

喜欢而已 提交于 2019-12-09 07:30:36
问题 I have a simple View and I wish to add a JQuery DatePicker JavaScript to this view (and not every view, via a masterpage). I'm not sure what is the best way to do this. Second, I'm conscious of where/when my JavaScript loads. I'm a fan of YSlow and it recommends that I add any scripts to the bottom of the page, which I do. So, how could I do both? Here's the view: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> <asp:Content ID="Content1

EF 4 Code First - Combine Views and Tables

。_饼干妹妹 提交于 2019-12-09 01:57:47
问题 I researched this question for days and cannot seem to find an option I feel good about; however, here is a link to a very similar question: Add Calculated field to Model Ultimately, I have the same question, but I am hoping for a better solution. Consider the following DB Tables: CREATE TABLE [Contact]( [ContactID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [ContactName] [varchar](80) NOT NULL, [Email] [varchar](80) NOT NULL, [Title] [varchar](120) NOT NULL, [Address1] [varchar](80)

Alternative to using a subquery - can't create view in Mysql

泄露秘密 提交于 2019-12-08 13:21:06
问题 I have created a view that pulls a range of rows based on a calculation; using this script (per this question: How to select Range of rows based on field values - MySQL : select t.* from curdataEvents t cross join (select max(revs) as maxrev from curdataEvents) x where t.revs >= x.maxrev - 100000; This pulls the range of rows I need. In order to get the desired report - I have to create multiple views each creating the next layer of the report. The problem is MySQL won't create a view using a

Circle/daisy layout (pinwheel) in Android?

纵饮孤独 提交于 2019-12-08 12:09:04
问题 I want to create a circle layout. All of my views should be in the circle. Which layout do I have to prefer and how? The focus of the layout should be a clockwise circle. Edit: I can do this view and it is an update of my question, prompted by the comments to this question. Is there any example for doing that? The screenshot is attached below. image http://www.freeimagehosting.net/uploads/e11f35e522.png 回答1: For people who is coming to this question now I recently had to implement this circle

Not wrapping css div with field_with_errors for fields created with f.text_field but works for f.input

拟墨画扇 提交于 2019-12-08 11:21:02
问题 I'm having problems with my views. I'm using zurb foundation for stylesheets and when I enter wrong input in forms I get the error above the form but the fields containing the errors are not wrapped with red. Looking further into this there is no field_with_errors div wrapper for the input fields. After looking further into this I found out if I use f.input instead of f.text_field I get the correct error wrapping. As zurb has styles for text_field, text_area etc. I'm using those but I don't