diff --git a/umbraco/cms/businesslogic/template/Template.cs b/umbraco/cms/businesslogic/template/Template.cs index 1c2c0900f1..b6b622da61 100644 --- a/umbraco/cms/businesslogic/template/Template.cs +++ b/umbraco/cms/businesslogic/template/Template.cs @@ -331,14 +331,20 @@ namespace umbraco.cms.businesslogic.template { return DocumentType.GetAllAsList().Where(x => x.allowedTemplates.Select(t => t.Id).Contains(this.Id)); } - public IEnumerable GetContent() + public IEnumerable> GetContent() { List> list = new List>(); - using (IRecordsReader dr = SqlHelper.ExecuteReader("Select nodeid, text from cmsDocument where templateId = " + this.Id)) + using (IRecordsReader dr = SqlHelper.ExecuteReader("Select nodeid, text from cmsDocument where published = 1 and templateId = " + this.Id)) { + int i = 0; while (dr.Read()) { list.Add(new System.Tuple(dr.GetInt("nodeid"), dr.GetString("text"))); + i++; + if (i >= 100) + { + break; + } } dr.Close(); }